我每10秒将壁橱的电流(I in Ampere)和电压(U in Volt)输入到prometheus实例中。壁框在插入电动汽车时自然会报告较高的电流,而当不插电时则会报告较低的电流(当然,由于壁框的连接功能,某些基线电流仍然存在)。
现在我对Prometheus和PromQL非常陌生,我想知道我将如何在时间上从这些单一的点得到聚集的数据,也就是说,我想得到瓦特小时,并在这些时间点上进行进一步的聚合。
IIRC电气工作是由W = U x I x t计算的,所以我的想法是以某种方式将单个值汇总到一个小时的总价值,如下所示:
// somehow get t(0), the first times
我的任务是生成5000个介于-2和5之间的随机数,然后计算这些值中有多少介于2和3之间,这是到目前为止我得到的结果:
randNums=rand(1,5000); %Generate 5000 random values between 0 and 1
randNums=randNums*7-2; %Get those random values to be between -2 and 5
我知道7*1=7和0*7=0 so -2分别等于7-2,但我不能完全理解如果数字在5,6或-6和1之间,如何再次应用它。
我正在尝试将查询从InfluxDB查询重写为PromQL:
SELECT non_negative_derivative("wait_time_ms", 1s) FROM "sqlserver_waitstats" WHERE ("sql_instance" =~ /^$InstanceName$/) AND ("wait_type" =~ /HADR/) AND $timeFilter GROUP BY "wait_type"
有人能帮忙吗?
所以我在网上找到了Unity的一个脚本,它是一个白天和夜晚的周期,但是它是以小数形式工作的,从0.1到1,但是我希望它是1到24。
下面是我正在使用的代码,我试过摆弄十进制值,但是我不能正确地处理它。
using UnityEngine;
using System.Collections;
public class DayNightCycle : MonoBehaviour {
public Light sun;
public float secondsInFullDay = 120f;
[Range(0,24)]
public float curr
在Prometheus PromQL中,是否有可能在距离向量中计算缺席量?
我正在寻找最简单的方法来生成基于缺席度量的正常运行时间信息。
count_over_time(absent(metric_name)[1w]),但它抛出了Error executing query: parse error at char 56: range specification must be preceded by a metric selector, but follows a *promql.Call instead
不幸的是,我不能使用规则,因为我需要回到过去。
我使用的解决方法是计算此查询的结果。
/