Is there a way to count the number of cycles in a graph of repeated cycles?

Hi Community Superfriends,

I was wondering if there is a fast way to count the number of cycles in a graph. For example, I have a graph full of repetitive cycles and they literally all look the same and hit the same values, I just want to count them. Some of these graphs contain over 300 cycles, and if I was to hand count each peak (or trough) it would take forever. Is there a fast and simple way to just count?

Thank you

Hi,

I’m looking for the same thing. I have curing cycle in an oven and wanted to use peak counts to see product throughput just by counting the highest temp in that cycle.

Did you resolve this.

Thanks in advance

Hi @clawsonpaul

What is your datasource and what query language are you currently using?

Hi Grant, my datasource is from influx which in turn is fed via node red.

Language wise. I use the influx query builder. Copy and paste this into grafana.

Hi @clawsonpaul but it’s not clear to me if you are using Flux or InfluxQL.

Appoligies. Flux

Hi again @clawsonpaul

This is not perfect, but might help you get started…

I think you will need to define the time interval for a typical cycle (10 minutes, 14 hours, 1 day, etc.).

Below is some temperature data that I have for 5 days, where it’s very clear there is a peak every 1 day. So I wrote the query as shown:

from(bucket: "sampledata")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "WeatherData")
  |> filter(fn: (r) => r["_field"] == "OutdoorTemp")
  |> aggregateWindow(every: 1d, fn: max, createEmpty: false)
  |> count()
  |> yield(name: "max")

Thankyou Grant.

I’ll work through this. Its a great start.

Would this work for pump cycles as well?
Using for PI Time Series Data.

  1. Require to count run cycles of pumps
  2. Compare the result and display it in percentage difference

Welcome @fa8542triangle to the Grafana forum.

I do not see why not. Did you try adapting the Flux query above?