// generate the anomaly counts for a single service
generate the anomaly counts for a single service
// generate the anomaly counts for a single service
func GenerateReport(serviceName string, info JobInfoM, currentYear *int, currentMonth *time.Month, currentDay *int) string {
	customMetricPrefix := "custom.iks.foremast."
	baseQuery := `count(ts(REPLACE_METRIC_anomaly, app=APPNAME), app)`
	now := time.Now()
	unix := now.Unix()
	anomalycounts := now.Format("2006-01-02T15:04:05Z07:00")
	for metricName, _ := range info.MetricMap {
		metricAnomalyCount := strconv.FormatFloat(QueryWavefrontAnomalyCount(serviceName, baseQuery, customMetricPrefix+metricName, unix, currentYear, currentMonth, currentDay), 'f', -1, 64)
		anomalycounts = anomalycounts + "\t" + metricAnomalyCount
	}
	return anomalycounts + "\n"
}
func GenerateReport ( serviceName string , info JobInfoM , currentYear * int , currentMonth * time . Month , currentDay * int ) string { customMetricPrefix := " " baseQuery := `count(ts(REPLACE_METRIC_anomaly, app=APPNAME), app)` now := time . Now ( ) unix := now . Unix ( ) anomalycounts := now . Format ( " " ) for metricName , _ := range info . MetricMap { metricAnomalyCount := strconv . FormatFloat ( QueryWavefrontAnomalyCount ( serviceName , baseQuery , customMetricPrefix + metricName , unix , currentYear , currentMonth , currentDay ) , 'f' , - 1 , 64 ) anomalycounts = anomalycounts + " \t " + metricAnomalyCount } return anomalycounts + " \n " }
generate the anomaly counts for a single service
generate the anomaly counts for a single service
// custom metric prefix for foremast upper/lower/anomaly metrics // we want a count of anomalies for the metric types over the past day