giving up the ghost vs with one foot in the grave

giving up the ghost

with one foot in the grave

How often have the words giving up the ghost and with one foot in the grave occurred in a corpus of books? (source: Google Ngram Viewer )