Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
add cache and rendering metrics, idea from @jssjr
Browse files Browse the repository at this point in the history
  • Loading branch information
obfuscurity committed Oct 26, 2013
1 parent 4aa1dea commit e7983dd
Show file tree
Hide file tree
Showing 2 changed files with 213 additions and 5 deletions.
214 changes: 211 additions & 3 deletions templates/collectd/collectd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ LoadPlugin processes
#LoadPlugin snmp
LoadPlugin swap
#LoadPlugin table
#LoadPlugin tail
LoadPlugin tail
#LoadPlugin tcpconns
#LoadPlugin teamspeak2
#LoadPlugin ted
Expand Down Expand Up @@ -791,7 +791,215 @@ LoadPlugin write_graphite
# </Table>
#</Plugin>

#<Plugin "tail">
<Plugin "tail">

# cache performance
<File "/opt/graphite/storage/log/webapp/cache.log">
Instance "graphite_web"
<Match>
Regex "Request-Cache hit "
DSType "CounterInc"
Type "counter"
Instance "request_cache_hit"
</Match>
<Match>
Regex "Request-Cache miss "
DSType "CounterInc"
Type "counter"
Instance "request_cache_miss"
</Match>
<Match>
Regex "CarbonLink creating a new socket "
DSType "CounterInc"
Type "counter"
Instance "socket_create_count"
</Match>
<Match>
Regex "CarbonLink cache-query request "
DSType "CounterInc"
Type "counter"
Instance "query_count"
</Match>
<Match>
Regex "CarbonLink set-metadata request "
DSType "CounterInc"
Type "counter"
Instance "set-metadata_count"
</Match>
<Match>
Regex "Data-Cache hit "
DSType "CounterInc"
Type "counter"
Instance "data_cache_hit"
</Match>
<Match>
Regex "Data-Cache miss "
DSType "CounterInc"
Type "counter"
Instance "data_cache_miss"
</Match>
</File>

# rendering performance
<File "/opt/graphite/storage/log/webapp/rendering.log">
Instance "graphite_web"

# PNG's
<Match>
Regex "Rendered PNG in ([0-9\.]+) seconds"
DSType "CounterInc"
Type "requests"
Instance "render_png_count"
</Match>
<Match>
Regex "Rendered PNG in ([0-9\.]+) seconds"
DSType "GaugeMin"
Type "response_time"
Instance "render_png_time_min"
</Match>
<Match>
Regex "Rendered PNG in ([0-9\.]+) seconds"
DSType "GaugeMax"
Type "response_time"
Instance "render_png_time_max"
</Match>
<Match>
Regex "Rendered PNG in ([0-9\.]+) seconds"
DSType "GaugeAverage"
Type "response_time"
Instance "render_png_time_avg"
</Match>

# pickle (carbonlink)
<Match>
Regex "Total pickle rendering time ([0-9\.]+)"
DSType "CounterInc"
Type "counter"
Instance "render_pickle_count"
</Match>
<Match>
Regex "Total pickle rendering time ([0-9\.]+)"
DSType "GaugeMin"
Type "response_time"
Instance "render_pickle_time_min"
</Match>
<Match>
Regex "Total pickle rendering time ([0-9\.]+)"
DSType "GaugeMax"
Type "response_time"
Instance "render_pickle_time_max"
</Match>
<Match>
Regex "Total pickle rendering time ([0-9\.]+)"
DSType "GaugeAverage"
Type "response_time"
Instance "render_pickle_time_avg"
</Match>

# rawData (json, csv, etc)
<Match>
Regex "Total rawData rendering time ([0-9\.]+)"
DSType "CounterInc"
Type "counter"
Instance "render_rawdata_count"
</Match>
<Match>
Regex "Total rawData rendering time ([0-9\.]+)"
DSType "GaugeMin"
Type "response_time"
Instance "render_rawdata_time_min"
</Match>
<Match>
Regex "Total rawData rendering time ([0-9\.]+)"
DSType "GaugeMax"
Type "response_time"
Instance "render_rawdata_time_max"
</Match>
<Match>
Regex "Total rawData rendering time ([0-9\.]+)"
DSType "GaugeAverage"
Type "response_time"
Instance "render_rawdata_time_avg"
</Match>

# total render time
<Match>
Regex "Total rendering time ([0-9\.]+) seconds"
DSType "CounterInc"
Type "counter"
Instance "total_render_count"
</Match>
<Match>
Regex "Total rendering time ([0-9\.]+) seconds"
DSType "GaugeMin"
Type "response_time"
Instance "total_render_time_min"
</Match>
<Match>
Regex "Total rendering time ([0-9\.]+) seconds"
DSType "GaugeMax"
Type "response_time"
Instance "total_render_time_max"
</Match>
<Match>
Regex "Total rendering time ([0-9\.]+) seconds"
DSType "GaugeAverage"
Type "response_time"
Instance "total_render_time_avg"
</Match>

# cached response time
<Match>
Regex "Returned cached response in ([0-9\.]+) seconds"
DSType "CounterInc"
Type "counter"
Instance "cached_response_time_count"
</Match>
<Match>
Regex "Returned cached response in ([0-9\.]+) seconds"
DSType "GaugeMin"
Type "response_time"
Instance "cached_response_time_min"
</Match>
<Match>
Regex "Returned cached response in ([0-9\.]+) seconds"
DSType "GaugeMax"
Type "response_time"
Instance "cached_response_time_max"
</Match>
<Match>
Regex "Returned cached response in ([0-9\.]+) seconds"
DSType "GaugeAverage"
Type "response_time"
Instance "cached_response_time_avg"
</Match>

# data retrieval time
<Match>
Regex "Retrieval of [^ ]+ took ([0-9\.]+)"
DSType "CounterInc"
Type "counter"
Instance "retrieval_count"
</Match>
<Match>
Regex "Retrieval of [^ ]+ took ([0-9\.]+)"
DSType "GaugeMin"
Type "response_time"
Instance "retrieval_time_min"
</Match>
<Match>
Regex "Retrieval of [^ ]+ took ([0-9\.]+)"
DSType "GaugeMax"
Type "response_time"
Instance "retrieval_time_max"
</Match>
<Match>
Regex "Retrieval of [^ ]+ took ([0-9\.]+)"
DSType "GaugeAverage"
Type "response_time"
Instance "retrieval_time_avg"
</Match>
</File>
# <File "/var/log/exim4/mainlog">
# Instance "exim"
# <Match>
Expand All @@ -808,7 +1016,7 @@ LoadPlugin write_graphite
# Instance "local_user"
# </Match>
# </File>
#</Plugin>
</Plugin>

#<Plugin tcpconns>
# ListeningPorts false
Expand Down
4 changes: 2 additions & 2 deletions templates/graphite/webapp/local_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#DOCUMENTATION_URL = "http://graphite.readthedocs.org/"

# Logging
#LOG_RENDERING_PERFORMANCE = True
#LOG_CACHE_PERFORMANCE = True
LOG_RENDERING_PERFORMANCE = True
LOG_CACHE_PERFORMANCE = True
#LOG_METRIC_ACCESS = True

# Enable full debug page display on exceptions (Internal Server Error pages)
Expand Down

0 comments on commit e7983dd

Please sign in to comment.