I was trying to figure out about how many host-unit-hrs I was paying for non-prod hosts.
fetch dt.entity.host<br>| fieldsAdd entity.type, entity.name, lifetime, tags, hypervisorType, memoryTotal, physicalMemory, paasMemoryLimit<br>| filterOut in(tags, array("[AWS]environment:prod", "environment-custom:prod"))<br>| fieldsAdd ts_30d_ago=now()-30d<br>| fieldsAdd start_ts=arrayMax(array(ts_30d_ago, toTimestamp(lifetime[start]))), end_ts=toTimestamp(lifetime[end])<br>| fieldsAdd hrs=ceil(toLong(end_ts-start_ts)/1000000000/60/60.0)<br>| fieldsRemove start_ts, end_ts<br>| fieldsAdd gb=if(paasMemoryLimit>0, paasMemoryLimit*1024*1024, else: memoryTotal)/1024/1024/1024.0<br>| fieldsAdd gb_hrs=gb*hrs<br>| summarize sum(gb_hrs), alias:total_gb_hrs<br>| fieldsAdd host_unit_hrs=total_gb_hrs/8
I ran the above query for 30d and it took 25sec. But it said “Scanned bytes: 0 B” so I wasn’t sure how expensive this query was in overall license cost.
Is there a general way to estimate license cost for a given query?