Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collector [performancecounter] Feedback and question #1827

Open
JDA88 opened this issue Jan 6, 2025 · 4 comments
Open

Collector [performancecounter] Feedback and question #1827

JDA88 opened this issue Jan 6, 2025 · 4 comments

Comments

@JDA88
Copy link
Contributor

JDA88 commented Jan 6, 2025

Problem Statement

I have been paying around with the promising performancecounter collector and I have a few feedback:

Naming:


"name": "Cache (Data) Bytes" generate a metric named:
..._cache__data__bytes
it should be:
..._cache_data_bytes
=> Maybe a general replace __ by _ at the end?


"name": "Write Cache %" generate a metric named:
..._cache_write_cache
it could be:
..._cache_write_cache_percent
=> Maybe replace % by percent


Question:
Is there a way to get the raw value of computed counter? Like getting Cache Faults Total instead of Cache Faults/sec
This will increase the usefullness of this collector by a lot as compted values are always very aproximative for values that move a lot.
If not possible, is the returned the one at the call or the average between the call and the previous call?

@jkroepke
Copy link
Member

jkroepke commented Jan 7, 2025

Hi, thanks for the feedback!

Is there a way to get the raw value of computed counter?

Seems the documentation lacks here. At the moment, only raw values are fetched from the performancecounter. How ever, a few value counter types will computed, for example counters based on Windows epoch will be converted into unix timestamp based values.

@JDA88
Copy link
Contributor Author

JDA88 commented Jan 8, 2025

Ok, unfurtunaly the one i need are "%" and "/Sec" so, no raw values :(

@jkroepke
Copy link
Member

jkroepke commented Jan 8, 2025

Of course, the name of performance counters are fixed.

If you run

(Get-Counter '\Memory\Cache Faults/Sec').CounterSamples[0] | Format-List *

You got a CookedValue and a RawValue. The CookedValue is the formatted value based on the RawValue (https://learn.microsoft.com/en-us/windows/win32/perfctrs/calculating-counter-values).

In that case, RawValue should be only increment while the CookedValue represent the per second value.

Request \Memory\Cache Faults/Sec to gain Cache Faults Total is the way to go.

Ref:

ch <- prometheus.MustNewConstMetric(
c.cacheFaultsTotal,
prometheus.CounterValue,
c.perfDataObject[0].CacheFaultsPerSec,
)

Here is that prof that windows_export report that as counter (increment only) for a per second value.

@JDA88
Copy link
Contributor Author

JDA88 commented Jan 8, 2025

Damn I forgot how to get the RawValue name string. Thanks your for that, I'll give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants