Book Image

Learning Heroku Postgres

By : Patrick Rafael de Oliveira Espake
Book Image

Learning Heroku Postgres

By: Patrick Rafael de Oliveira Espake

Overview of this book

Table of Contents (17 chapters)
Learning Heroku Postgres
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Keyword List
Index

Metrics logs


Heroku Postgres has a log statement that provides metrics on database usage. This feature is important to monitor the behavior of the database over time.

The metrics information helps you improve database configurations, and identify critical issues, it also teaches you how to improve your application's architecture.

To view the metrics logs, you should use the heroku logs command by filtering through the heroku-postgres process, as shown in the following example:

$ heroku logs -p heroku-postgres -t --app your-app-name
2014-11-02T00:35:38+00:00 app[heroku-postgres]: source=HEROKU_POSTGRESQL_CHARCOAL sample#current_transaction=179097 sample#db_size=61229240bytes sample#tables=38 sample#active-connections=9 sample#waiting-connections=0 sample#index-cache-hit-rate=0.99999 sample#table-cache-hit-rate=1 sample#load-avg-1m=0.395 sample#load-avg-5m=0.44 sample#load-avg-15m=0.435 sample#read-iops=17.042 sample#write-iops=1.7437 sample#memory-total=7629452kB sample#memory-free=64876kB...