PerfView's Metric/Interval greater than 1? - perfview

According to some PerfView material that I have seen/read online, I should dig into further CPU investigation if the Metric/msec is close to 1 (ex: 0.92), but I am seeing that in my case this value is 10.62. What does this mean?
Totals
Metric: 218,443.0
Count: 218,443.0
First: 353.835
Last: 20,927.284
Last-First: 20,573.449
Metric/Interval: 10.62
TimeBucket: 686.0
TotalProcs 12
From Last-First, I can see that the profiling was done for 20,573 milliseconds, but the Metric is 218,443 samples. How come? Since PerfView takes one sample every 1 millisecond, I should not have seen this value greater than 20,573, right?
Is this count so high because the Metric here from ALL those 12 processors? If yes, so should I do the calculation like (218443/12)/20573, which gives me 0.88?

Related

LogQL: Time limit exceeded by mistake

I have written a LogQL query. I want to count the events over a period of 7 days and output them as a total.
7 days = 168h.
Here I have a screenshot.
If I enter the 168h at "count_over_time" I exceed the limit of 169h. This makes no sense to me.
What is the problem here? Where does the 182,5h come from?

Calculate data with overlapping dates in SQL

I'm using PostgreSQL 13 (I can update to 14 if that helps) and I'd like to return some rows based on data I've got.
The data I've got is a bit complex and comes from a few different tables but I don't think it matters here.
Currently I was able to create a query that returns data that looks like this:
Product ID Start End AvailableAmount
------------ ------------- ------------- ------------------
1 null null 2
1 2022-07-20 2022-07-22 1
1 2022-07-24 2022-07-27 1
2 null null 1
3 null null 5
Where Start is the start of a time period, End is the end of the period, AvailableAmount is the amount of product available in that time period. Available amount is calculated based on some other data.
I've tried summing up the AvailableAmount column but that does not return valid data because for time period from 2022-07-20 to 2022-07-24 AvailableAmount should be 1 but it's 2.
I think I'd need to somehow separate these dates and list the amount per day, not per time period but I don't know how.
Basically, going day by day, AvailableAmount for product with ID 1 should be:
2022-07-20: 1
2022-07-21: 1,
2022-07-22: 1,
2022-07-23: 2,
2022-07-24: 1,
2022-07-25: 1,
2022-07-26: 1,
2022-07-27: 1,
2022-07-28: 2,
...
so if I'd to query for the product with time period 2022-07-20 to 2022-07-25 I should be able to request 1 unit of the product. Currently my implementation makes it impossible as it's summing up the amount so if my request spans over two different time periods the available amount is lower than it should be.
I've tried using gaps and islands approach but I don't think it'd work here. I've also read about multirange that was introduced in v14 but I haven't tested it yet, working on it. I've also tried using generate_series but that did not help me.
I don't know if that is enough information but I can provide more if needed.
Thanks!

Count Iff [date] occured in the past 90 days ACCESS

I'm having a bit of trouble.
I am trying to build a Access query that counts the number of times a product was consumed based on if the date occurred with in the past 90 days and the status of the product being consumed.
I attempted this for just counting the occurrences for the past 90 days.
90 Days Consumption: Count(IIf([Movement]![Date]>Date()+90,[Movement]![Product],0))
It did not work. I'm not really sure how to also add the condition of it being the consumed status along with the past 90 days.
Anything helps.
"past 90 days" is today-90
90 Days Consumption: Count(IIf([Movement]![Date]>Date()-90,[Movement]![Product],0))
You might need to be careful with using COUNT() here because this function counts ANY non-null as 1, so the IIF() can return zero, which is non-null. Perhaps this instead:
90 Days Consumption: Sum(IIf([Movement]![Date]>Date()-90,1,0))

Prometheus / Grafana highest value and time

Is it possible in grafana with a prometheus backend to determine the highest value recorded for the lifetime of a data set, and if so, determine the time that the value occurred?
For example, I'm using site_logged_in as the query in a Singlestat panel to get the current number of logged in users, along with a nice graph of recent activity over the past hour. Wrapping that in a max() seems to do nothing, and a max_over_time(site_logged_in[1y]) gives me a far too low number.
The value is a single gauge value coming from the endpoint like so
# HELP site_logged_in Logged In Members
# TYPE site_logged_in gauge
site_logged_in 583
Is something like determining highest values even a realistic use case for prometheus?
max_over_time(site_logged_in[1y]) is the max over the past year, however this presumes that you have a year worth of data to work from.
The highest value over the specified time range can be obtained with max_over_time() function. For example, the following value would return the maximum value for site_logged_in metric over the last year:
max_over_time(site_logged_in[1y])
Unfortunately Prometheus doesn't provide the function for returning the timestamp for the maximum value. If you need to obtain the timestamp for the maximum value, then you can use tmax_over_time() function from MetricsQL. For example, the following MetricsQL query returns the timestamp in seconds for the maximum value of site_logged_in metric over the last year:
tmax_over_time(site_logged_in[1y])

Hide Total Row in Rep[orting services

I have a report with total lines after a show is being reported.
A show may run a week or several weeks. I want to hide the total line when there is only 1 week for the show but display the total line when there are more than one week. The example below should hide the Total row for "An American In Paris" but show for the other shows because they run for more than 1 week.I group by performance, week, start date.
I have tried:
=IIF(SUM(Fields!week_performance.Value)<=1,True,False)
and
=IIF((Fields!week_performance.Value)<=1,True,False)
neither seems to work, even if week = 1 the total line still shows
Performance week sales
A Gentlemens guide to Love & Murder 1 1500
2 2000
Total 3500
An American in Paris 1 1800
Total 1800
First Date 1 1900
2 2100
3 1800
Total 58000
I think what you need is the CountRows() function. In this case, using it as follows will default to the current scope (i.e., the group of the showing, in this case) and should count just 1.
=IIF(CountRows() = 1,true,false)
In addition to CountRows(), if you had some unique value per showing, you could use the following:
=IIF(CountDistinct(Fields!UniqueID.Value) = 1,true,false)
If this doesn't work, reply as a comment and I'll do my best to help.