Rename current db to boltdb
This commit is contained in:
@@ -5,8 +5,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"gitea.hashru.nl/dsprenkels/rushlink/internal/db"
|
||||
|
||||
"gitea.hashru.nl/dsprenkels/rushlink/internal/boltdb"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
@@ -23,7 +22,7 @@ var metricRequestsTotalCounter = prometheus.NewCounterVec(prometheus.CounterOpts
|
||||
Help: "How many HTTP requests processed, partitioned by status code and HTTP method.",
|
||||
}, []string{"code", "method"})
|
||||
|
||||
func metricURLsTotal(database *db.Database) float64 {
|
||||
func metricURLsTotal(database *boltdb.Database) float64 {
|
||||
var metric float64
|
||||
if err := database.Bolt.View(func(tx *bolt.Tx) error {
|
||||
bucket := tx.Bucket([]byte("pastes"))
|
||||
@@ -40,7 +39,7 @@ func metricURLsTotal(database *db.Database) float64 {
|
||||
}
|
||||
|
||||
// StartMetricsServer starts sering Prometheus metrics exports on addr
|
||||
func StartMetricsServer(addr string, database *db.Database, fs *db.FileStore) {
|
||||
func StartMetricsServer(addr string, database *boltdb.Database, fs *boltdb.FileStore) {
|
||||
prometheus.MustRegister(metricRequestsTotalCounter)
|
||||
|
||||
prometheus.MustRegister(prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
||||
|
||||
Reference in New Issue
Block a user