mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
* first cut at pre-sort command that works on ndjson * finish pre_sort command for CSV and JSON and add test * try fixing golangci-lint * remove some dumb lint checks * more linter disabling * take .golangci.yml from previous repo * go fmt (facepalm) * remove ioutil to fix lint
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
// Copyright 2022 Molecula Corp. (DBA FeatureBase).
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
package prometheus_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/featurebasedb/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
|
|
}
|