mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-06 00:25:55 +00:00
* performance counters * first cut of perf counters and system table fanout and a wire protocol * significantly refactored prometheus support; removed statsd and exprvar * removed node_id * put dax subquery test back * Change Translator.TranslateFieldIDs method to take a dax.TableKeyer There are a bunch of other calls to the Translator interface methods with currently take an `index string`, and those need to be converted to dax.TableKeyer as well. But I need to review each call, because in at least one place I noticed one being called with `result.Index` instead of with the qtbl available. And I don't yet know how those could be different. Co-authored-by: Travis Turner <travis@molecula.com>
41 lines
1 KiB
Go
41 lines
1 KiB
Go
// Copyright 2021 Molecula Corp. All rights reserved.
|
|
package prometheus_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/molecula/featurebase/v3/test"
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
io_prometheus_client "github.com/prometheus/client_model/go"
|
|
)
|
|
|
|
func TestPrometheusClient_Methods(t *testing.T) {
|
|
c := test.MustRunCluster(t, 1)
|
|
defer c.Close()
|
|
|
|
metricFams, err := prometheus.DefaultGatherer.Gather()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
for _, metricName := range []string{
|
|
"pilosa_sql_statistics_sql_bulk_insert_batches_sec",
|
|
"pilosa_sql_statistics_sql_bulk_inserts_sec",
|
|
"pilosa_sql_statistics_sql_deletes_sec",
|
|
"pilosa_sql_statistics_sql_inserts_sec",
|
|
"pilosa_sql_statistics_sql_requests_sec",
|
|
} {
|
|
if metricExists(metricName, metricFams) {
|
|
continue
|
|
}
|
|
t.Fatalf("metric does not exist: %s", metricName)
|
|
}
|
|
}
|
|
|
|
func metricExists(metricName string, metricFams []*io_prometheus_client.MetricFamily) bool {
|
|
for _, metricFam := range metricFams {
|
|
if metricFam.GetName() == metricName {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|