MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / TestDB_Metrics

Function TestDB_Metrics

driver/hybriddb/db_test.go:300–325  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

298}
299
300func TestDB_Metrics(t *testing.T) {
301 tempDir := t.TempDir()
302 cfg := &config.Config{
303 LevelDB: config.LevelDBConfig{
304 CacheSize: 64 * 1024 * 1024,
305 BlockSize: 4 * 1024,
306 WriteBufferSize: 4 * 1024 * 1024,
307 MaxOpenFiles: 1000,
308 Compression: true,
309 },
310 }
311
312 dbInterface, err := Store{}.Open(tempDir, cfg)
313 require.NoError(t, err)
314 defer dbInterface.Close()
315
316 // Type assert to access Metrics method
317 db, ok := dbInterface.(*DB)
318 require.True(t, ok, "Expected *DB type")
319
320 title, metrics := db.Metrics()
321
322 assert.Equal(t, "hybriddb", title)
323 assert.NotNil(t, metrics)
324 // Metrics might be empty if cache is disabled, so we don't check length
325}
326
327func TestDB_ConcurrentAccess(t *testing.T) {
328 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 4

CloseMethod · 0.65
EqualMethod · 0.65
OpenMethod · 0.45
MetricsMethod · 0.45

Tested by

no test coverage detected