graph of values in the log
I have a log that writes the average performance (in seconds to return a page) in a field called wt.method.MethodContextMonitor.stats.summary once a minute.
I would like to graph the actual value displayed in the log - not a count of how many times it writes the information (since that's constant). I wrote this simple query
_sourceCategory="prod/app/windchill/methodserver" wt.method.MethodContextMonitor.stats.summary |parse "ContextSecondsAverage=*," as _contextSecondsAverage
I can see a Time column, contextSecondsAverage column and the Message column in the log pane. I just want to graph Time on the X axis and contextSecondsAverage on the Y axis. I tried
_sourceCategory="prod/app/windchill/methodserver" wt.method.MethodContextMonitor.stats.summary |parse "ContextSecondsAverage=*," as _contextSecondsAverage|transpose row _messagetime column _contextsecondsaverage
but it says
requirement failed: transpose: no aggregated values present
-
Hello Adam!
You can only graph aggregated data, thus in order to plot your values you need to formulate the statement in a way that make aggregate values available to Sumo. For example you could bin your data using "timeslice" operator and then use
sum(_contextSecondsAverage)/count(_contextSecondsAverage) by _timeslice (which will give you an average over the timeslice)
or
(assuming you define very granular timeslice, eg. 1s, which will be more granular than the frequency of your log entries)
sum(_contextSecondsAverage) by _timeslice
|where _sum > 0
(which will give you your values expressed as values of an aggregate function).Please let me know if these comments helped or if you found them not applicable to your case.
-
I tried
_sourceCategory="prod/app/windchill/methodserver" wt.method.MethodContextMonitor.stats.summary |parse "ContextSecondsAverage=*," as _contextSecondsAverage| timeslice by 10s |sum(_contextSecondsAverage) by _timeslice|where _sum > 0
that got me closer. I now have basically the same columns. A "Time" column and a "_sum" column that has the values I'd like to graph. The difference is that now it's in an Aggregates tab. So I tried adding the same transpose stuff as before, but with my new columns
_sourceCategory="prod/app/windchill/methodserver" wt.method.MethodContextMonitor.stats.summary |parse "ContextSecondsAverage=*," as _contextSecondsAverage| timeslice by 10s |sum(_contextSecondsAverage) by _timeslice|where _sum > 0 |transpose row Time column _sum
I don't get the aggregates error, but I get an error that says "Field Time not found, please check spelling and try again."
how do I get a graph of the values and not the count of log entries?
-
The error complain that it can't find the "Time" field. Even though the column header says "Time", from within the query the field name is different. In this case it would be "_timeslice". Please try substituting "Time" for "_timeslice" and generating your graph again.
I would appreciate if you could please let me know if that helped.
-
I tried
_sourceCategory="prod/app/windchill/methodserver" wt.method.MethodContextMonitor.stats.summary |parse "ContextSecondsAverage=*," as _contextSecondsAverage| timeslice by 10s |sum(_contextSecondsAverage) by _timeslice|where _sum > 0|transpose row _timeslice column _sum
and it doesn't give me any error, but it still just gives a graph of the number of log entries per timeslice Which is surprising to me
-
Adam,
I think the last step from achieving your goal is to remove the unnecessary "transpose" operator. Try running the exact same query you posted in your last post, take away the "transpose" operator and try charting your data using a line graph.
Please let me know how that worked out for you.
Thank you!
Please sign in to leave a comment.
Comments
6 comments