Re: keeping a timestamp of the last stats reset (for a db, table and function)
Greg Smith <greg@2ndquadrant.com>
From: Greg Smith <greg@2ndquadrant.com>
To: Tomas Vondra <tv@fuzzy.cz>
Cc: pgsql-hackers@postgresql.org
Date: 2011-02-06T07:17:27Z
Lists: pgsql-hackers
Attachments
- stat-time-reset-4.diff (text/x-patch) patch
Tomas Vondra wrote: > Because when I create a database, the field is > NULL - that's true. But once I connect to the database, the stats are > updated and the field is set (thanks to the logic in pgstat.c). > OK--so it does what I was hoping for, I just didn't test it the right way. Let's call that a documentation issue and move on. Attached is an updated patch that fixes the docs and some other random bits. Looks ready for committer to me now. Make sure to adjust PGSTAT_FILE_FORMAT_ID, do a cat version bump, and set final OIDs for the new functions. Below is what changed since the last posted version, mainly as feedback for Tomas: -Explained more clearly that pg_stat_reset and pg_stat_reset_single_counters will both touch the database reset time, and that it's initialized upon first connection to the database. -Added the reset time to the list of fields in pg_stat_database and pg_stat_bgwriter. -Fixed some tab/whitespace issues. It looks like you had tab stops set at 8 characters during some points when you were editing non-code files. Also, there were a couple of spot where you used a tab while text in the area used spaces. You can normally see both types of errors if you read a patch, they showed up as misaligned things in the context diff. -Removed some extra blank lines that didn't fit the style of the surrounding code. Basically, all the formatting bits I'm nitpicking about I found just by reading the patch itself; they all stuck right out. I'd recommend a pass of that before submitting things if you want to try and avoid those in the future. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books