Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Cloudprober should export its runtime stats #53

Closed
manugarg opened this issue Dec 15, 2017 · 2 comments
Closed

Cloudprober should export its runtime stats #53

manugarg opened this issue Dec 15, 2017 · 2 comments
Assignees

Comments

@manugarg
Copy link
Contributor

To help debugging any performance issues, cloudprober should export its runtime stats:

  1. No of gorotuines (runtime.NumGoroutine()) - gauge
  2. Fraction of time spent in GC (runtime.ReadMemStats - reflect.MemStats.GCCPUFraction) - counter
  3. Number of allocs and frees (runtime.Mallocs, runtime.Frees) - counter
  4. Overall CPU and memory usage of cloudprober. Memory usage can be obtained from runtime.MemStats.Sys (gauge). CPU usage will require us to parse /proc/self/stat and it will be Linux specific.

We can extend sysvar module and add another file that includes utilities to do all this.

@manugarg manugarg self-assigned this Dec 15, 2017
@manugarg
Copy link
Contributor Author

Following runtime metrics have been added:

Heap/Garbage collection related:
gc_time_msec -- Time spent in GC (counter)
mallocs -- Number of mallocs so far (counter)
frees - Number of frees so far (counter)

Others:
cpu_usage_msec -- cpu usage (counter)
goroutines -- number of goroutines at the moment (gauge)
mem_stats_sys_bytes - System memory allocated in bytes (gauge)
uptime_msec - uptime (counter)

@manugarg
Copy link
Contributor Author

manugarg referenced this issue Jan 26, 2018
…instruct Go compiler to ignore it.

ORIGINAL_AUTHOR=Manu Garg <manugarg@gmail.com>
PiperOrigin-RevId: 179256135
manugarg referenced this issue Jan 26, 2018
Add a few Go runtime stats to help with debugging cloudprober performance/health.

cloudprober 1513308467341380164 1513308517 labels=ptype=sysvars,probe=sysvars uptime=50 gc_time=1827920 mallocs=80363 frees=39703 cpu_usage=690762494
cloudprober 1513308467341380185 1513308567 labels=ptype=sysvars,probe=sysvars goroutines=161 mem_stats_sys=17836280

ORIGINAL_AUTHOR=Manu Garg <manugarg@gmail.com>
PiperOrigin-RevId: 179240256
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant