0.3.0 unit tests: disque and elasticsearch

This commit is contained in:
Cameron Sparr 2016-01-05 18:06:30 -07:00
parent 2e20fc413c
commit c4a7711e02
3 changed files with 309 additions and 364 deletions

View File

@ -7,7 +7,6 @@ import (
"testing" "testing"
"github.com/influxdb/telegraf/testutil" "github.com/influxdb/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
@ -55,42 +54,26 @@ func TestDisqueGeneratesMetrics(t *testing.T) {
err = r.Gather(&acc) err = r.Gather(&acc)
require.NoError(t, err) require.NoError(t, err)
checkInt := []struct { fields := map[string]interface{}{
name string "uptime": uint64(1452705),
value uint64 "clients": uint64(31),
}{ "blocked_clients": uint64(13),
{"uptime", 1452705}, "used_memory": uint64(1840104),
{"clients", 31}, "used_memory_rss": uint64(3227648),
{"blocked_clients", 13}, "used_memory_peak": uint64(89603656),
{"used_memory", 1840104}, "total_connections_received": uint64(5062777),
{"used_memory_rss", 3227648}, "total_commands_processed": uint64(12308396),
{"used_memory_peak", 89603656}, "instantaneous_ops_per_sec": uint64(18),
{"total_connections_received", 5062777}, "latest_fork_usec": uint64(1644),
{"total_commands_processed", 12308396}, "registered_jobs": uint64(360),
{"instantaneous_ops_per_sec", 18}, "registered_queues": uint64(12),
{"latest_fork_usec", 1644}, "mem_fragmentation_ratio": float64(1.75),
{"registered_jobs", 360}, "used_cpu_sys": float64(19585.73),
{"registered_queues", 12}, "used_cpu_user": float64(11255.96),
} "used_cpu_sys_children": float64(1.75),
"used_cpu_user_children": float64(1.91),
for _, c := range checkInt {
assert.True(t, acc.CheckValue(c.name, c.value))
}
checkFloat := []struct {
name string
value float64
}{
{"mem_fragmentation_ratio", 1.75},
{"used_cpu_sys", 19585.73},
{"used_cpu_user", 11255.96},
{"used_cpu_sys_children", 1.75},
{"used_cpu_user_children", 1.91},
}
for _, c := range checkFloat {
assert.True(t, acc.CheckValue(c.name, c.value))
} }
acc.AssertContainsFields(t, "disque", fields)
} }
func TestDisqueCanPullStatsFromMultipleServers(t *testing.T) { func TestDisqueCanPullStatsFromMultipleServers(t *testing.T) {
@ -137,42 +120,26 @@ func TestDisqueCanPullStatsFromMultipleServers(t *testing.T) {
err = r.Gather(&acc) err = r.Gather(&acc)
require.NoError(t, err) require.NoError(t, err)
checkInt := []struct { fields := map[string]interface{}{
name string "uptime": uint64(1452705),
value uint64 "clients": uint64(31),
}{ "blocked_clients": uint64(13),
{"uptime", 1452705}, "used_memory": uint64(1840104),
{"clients", 31}, "used_memory_rss": uint64(3227648),
{"blocked_clients", 13}, "used_memory_peak": uint64(89603656),
{"used_memory", 1840104}, "total_connections_received": uint64(5062777),
{"used_memory_rss", 3227648}, "total_commands_processed": uint64(12308396),
{"used_memory_peak", 89603656}, "instantaneous_ops_per_sec": uint64(18),
{"total_connections_received", 5062777}, "latest_fork_usec": uint64(1644),
{"total_commands_processed", 12308396}, "registered_jobs": uint64(360),
{"instantaneous_ops_per_sec", 18}, "registered_queues": uint64(12),
{"latest_fork_usec", 1644}, "mem_fragmentation_ratio": float64(1.75),
{"registered_jobs", 360}, "used_cpu_sys": float64(19585.73),
{"registered_queues", 12}, "used_cpu_user": float64(11255.96),
} "used_cpu_sys_children": float64(1.75),
"used_cpu_user_children": float64(1.91),
for _, c := range checkInt {
assert.True(t, acc.CheckValue(c.name, c.value))
}
checkFloat := []struct {
name string
value float64
}{
{"mem_fragmentation_ratio", 1.75},
{"used_cpu_sys", 19585.73},
{"used_cpu_user", 11255.96},
{"used_cpu_sys_children", 1.75},
{"used_cpu_user_children", 1.91},
}
for _, c := range checkFloat {
assert.True(t, acc.CheckValue(c.name, c.value))
} }
acc.AssertContainsFields(t, "disque", fields)
} }
const testOutput = `# Server const testOutput = `# Server

View File

@ -7,7 +7,7 @@ import (
"testing" "testing"
"github.com/influxdb/telegraf/testutil" "github.com/influxdb/telegraf/testutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )
@ -52,23 +52,15 @@ func TestElasticsearch(t *testing.T) {
"node_host": "test", "node_host": "test",
} }
testTables := []map[string]float64{ acc.AssertContainsTaggedFields(t, "elasticsearch_indices", indicesExpected, tags)
indicesExpected, acc.AssertContainsTaggedFields(t, "elasticsearch_os", osExpected, tags)
osExpected, acc.AssertContainsTaggedFields(t, "elasticsearch_process", processExpected, tags)
processExpected, acc.AssertContainsTaggedFields(t, "elasticsearch_jvm", jvmExpected, tags)
jvmExpected, acc.AssertContainsTaggedFields(t, "elasticsearch_thread_pool", threadPoolExpected, tags)
threadPoolExpected, acc.AssertContainsTaggedFields(t, "elasticsearch_fs", fsExpected, tags)
fsExpected, acc.AssertContainsTaggedFields(t, "elasticsearch_transport", transportExpected, tags)
transportExpected, acc.AssertContainsTaggedFields(t, "elasticsearch_http", httpExpected, tags)
httpExpected, acc.AssertContainsTaggedFields(t, "elasticsearch_breakers", breakersExpected, tags)
breakersExpected,
}
for _, testTable := range testTables {
for k, v := range testTable {
assert.NoError(t, acc.ValidateTaggedValue(k, v, tags))
}
}
} }
func TestGatherClusterStats(t *testing.T) { func TestGatherClusterStats(t *testing.T) {
@ -80,29 +72,15 @@ func TestGatherClusterStats(t *testing.T) {
var acc testutil.Accumulator var acc testutil.Accumulator
require.NoError(t, es.Gather(&acc)) require.NoError(t, es.Gather(&acc))
var clusterHealthTests = []struct { acc.AssertContainsTaggedFields(t, "elasticsearch_cluster_health",
measurement string clusterHealthExpected,
fields map[string]interface{} map[string]string{"name": "elasticsearch_telegraf"})
tags map[string]string
}{
{
"cluster_health",
clusterHealthExpected,
map[string]string{"name": "elasticsearch_telegraf"},
},
{
"indices",
v1IndexExpected,
map[string]string{"index": "v1"},
},
{
"indices",
v2IndexExpected,
map[string]string{"index": "v2"},
},
}
for _, exp := range clusterHealthTests { acc.AssertContainsTaggedFields(t, "elasticsearch_indices",
assert.NoError(t, acc.ValidateTaggedFields(exp.measurement, exp.fields, exp.tags)) v1IndexExpected,
} map[string]string{"index": "v1"})
acc.AssertContainsTaggedFields(t, "elasticsearch_indices",
v2IndexExpected,
map[string]string{"index": "v2"})
} }

View File

@ -489,271 +489,271 @@ const statsResponse = `
} }
` `
var indicesExpected = map[string]float64{ var indicesExpected = map[string]interface{}{
"indices_id_cache_memory_size_in_bytes": 0, "id_cache_memory_size_in_bytes": float64(0),
"indices_completion_size_in_bytes": 0, "completion_size_in_bytes": float64(0),
"indices_suggest_total": 0, "suggest_total": float64(0),
"indices_suggest_time_in_millis": 0, "suggest_time_in_millis": float64(0),
"indices_suggest_current": 0, "suggest_current": float64(0),
"indices_query_cache_memory_size_in_bytes": 0, "query_cache_memory_size_in_bytes": float64(0),
"indices_query_cache_evictions": 0, "query_cache_evictions": float64(0),
"indices_query_cache_hit_count": 0, "query_cache_hit_count": float64(0),
"indices_query_cache_miss_count": 0, "query_cache_miss_count": float64(0),
"indices_store_size_in_bytes": 37715234, "store_size_in_bytes": float64(37715234),
"indices_store_throttle_time_in_millis": 215, "store_throttle_time_in_millis": float64(215),
"indices_merges_current_docs": 0, "merges_current_docs": float64(0),
"indices_merges_current_size_in_bytes": 0, "merges_current_size_in_bytes": float64(0),
"indices_merges_total": 133, "merges_total": float64(133),
"indices_merges_total_time_in_millis": 21060, "merges_total_time_in_millis": float64(21060),
"indices_merges_total_docs": 203672, "merges_total_docs": float64(203672),
"indices_merges_total_size_in_bytes": 142900226, "merges_total_size_in_bytes": float64(142900226),
"indices_merges_current": 0, "merges_current": float64(0),
"indices_filter_cache_memory_size_in_bytes": 7384, "filter_cache_memory_size_in_bytes": float64(7384),
"indices_filter_cache_evictions": 0, "filter_cache_evictions": float64(0),
"indices_indexing_index_total": 84790, "indexing_index_total": float64(84790),
"indices_indexing_index_time_in_millis": 29680, "indexing_index_time_in_millis": float64(29680),
"indices_indexing_index_current": 0, "indexing_index_current": float64(0),
"indices_indexing_noop_update_total": 0, "indexing_noop_update_total": float64(0),
"indices_indexing_throttle_time_in_millis": 0, "indexing_throttle_time_in_millis": float64(0),
"indices_indexing_delete_total": 13879, "indexing_delete_total": float64(13879),
"indices_indexing_delete_time_in_millis": 1139, "indexing_delete_time_in_millis": float64(1139),
"indices_indexing_delete_current": 0, "indexing_delete_current": float64(0),
"indices_get_exists_time_in_millis": 0, "get_exists_time_in_millis": float64(0),
"indices_get_missing_total": 1, "get_missing_total": float64(1),
"indices_get_missing_time_in_millis": 2, "get_missing_time_in_millis": float64(2),
"indices_get_current": 0, "get_current": float64(0),
"indices_get_total": 1, "get_total": float64(1),
"indices_get_time_in_millis": 2, "get_time_in_millis": float64(2),
"indices_get_exists_total": 0, "get_exists_total": float64(0),
"indices_refresh_total": 1076, "refresh_total": float64(1076),
"indices_refresh_total_time_in_millis": 20078, "refresh_total_time_in_millis": float64(20078),
"indices_percolate_current": 0, "percolate_current": float64(0),
"indices_percolate_memory_size_in_bytes": -1, "percolate_memory_size_in_bytes": float64(-1),
"indices_percolate_queries": 0, "percolate_queries": float64(0),
"indices_percolate_total": 0, "percolate_total": float64(0),
"indices_percolate_time_in_millis": 0, "percolate_time_in_millis": float64(0),
"indices_translog_operations": 17702, "translog_operations": float64(17702),
"indices_translog_size_in_bytes": 17, "translog_size_in_bytes": float64(17),
"indices_recovery_current_as_source": 0, "recovery_current_as_source": float64(0),
"indices_recovery_current_as_target": 0, "recovery_current_as_target": float64(0),
"indices_recovery_throttle_time_in_millis": 0, "recovery_throttle_time_in_millis": float64(0),
"indices_docs_count": 29652, "docs_count": float64(29652),
"indices_docs_deleted": 5229, "docs_deleted": float64(5229),
"indices_flush_total_time_in_millis": 2401, "flush_total_time_in_millis": float64(2401),
"indices_flush_total": 115, "flush_total": float64(115),
"indices_fielddata_memory_size_in_bytes": 12996, "fielddata_memory_size_in_bytes": float64(12996),
"indices_fielddata_evictions": 0, "fielddata_evictions": float64(0),
"indices_search_fetch_current": 0, "search_fetch_current": float64(0),
"indices_search_open_contexts": 0, "search_open_contexts": float64(0),
"indices_search_query_total": 1452, "search_query_total": float64(1452),
"indices_search_query_time_in_millis": 5695, "search_query_time_in_millis": float64(5695),
"indices_search_query_current": 0, "search_query_current": float64(0),
"indices_search_fetch_total": 414, "search_fetch_total": float64(414),
"indices_search_fetch_time_in_millis": 146, "search_fetch_time_in_millis": float64(146),
"indices_warmer_current": 0, "warmer_current": float64(0),
"indices_warmer_total": 2319, "warmer_total": float64(2319),
"indices_warmer_total_time_in_millis": 448, "warmer_total_time_in_millis": float64(448),
"indices_segments_count": 134, "segments_count": float64(134),
"indices_segments_memory_in_bytes": 1285212, "segments_memory_in_bytes": float64(1285212),
"indices_segments_index_writer_memory_in_bytes": 0, "segments_index_writer_memory_in_bytes": float64(0),
"indices_segments_index_writer_max_memory_in_bytes": 172368955, "segments_index_writer_max_memory_in_bytes": float64(172368955),
"indices_segments_version_map_memory_in_bytes": 611844, "segments_version_map_memory_in_bytes": float64(611844),
"indices_segments_fixed_bit_set_memory_in_bytes": 0, "segments_fixed_bit_set_memory_in_bytes": float64(0),
} }
var osExpected = map[string]float64{ var osExpected = map[string]interface{}{
"os_swap_used_in_bytes": 0, "swap_used_in_bytes": float64(0),
"os_swap_free_in_bytes": 487997440, "swap_free_in_bytes": float64(487997440),
"os_timestamp": 1436460392944, "timestamp": float64(1436460392944),
"os_mem_free_percent": 74, "mem_free_percent": float64(74),
"os_mem_used_percent": 25, "mem_used_percent": float64(25),
"os_mem_actual_free_in_bytes": 1565470720, "mem_actual_free_in_bytes": float64(1565470720),
"os_mem_actual_used_in_bytes": 534159360, "mem_actual_used_in_bytes": float64(534159360),
"os_mem_free_in_bytes": 477761536, "mem_free_in_bytes": float64(477761536),
"os_mem_used_in_bytes": 1621868544, "mem_used_in_bytes": float64(1621868544),
} }
var processExpected = map[string]float64{ var processExpected = map[string]interface{}{
"process_mem_total_virtual_in_bytes": 4747890688, "mem_total_virtual_in_bytes": float64(4747890688),
"process_timestamp": 1436460392945, "timestamp": float64(1436460392945),
"process_open_file_descriptors": 160, "open_file_descriptors": float64(160),
"process_cpu_total_in_millis": 15480, "cpu_total_in_millis": float64(15480),
"process_cpu_percent": 2, "cpu_percent": float64(2),
"process_cpu_sys_in_millis": 1870, "cpu_sys_in_millis": float64(1870),
"process_cpu_user_in_millis": 13610, "cpu_user_in_millis": float64(13610),
} }
var jvmExpected = map[string]float64{ var jvmExpected = map[string]interface{}{
"jvm_timestamp": 1436460392945, "timestamp": float64(1436460392945),
"jvm_uptime_in_millis": 202245, "uptime_in_millis": float64(202245),
"jvm_mem_non_heap_used_in_bytes": 39634576, "mem_non_heap_used_in_bytes": float64(39634576),
"jvm_mem_non_heap_committed_in_bytes": 40841216, "mem_non_heap_committed_in_bytes": float64(40841216),
"jvm_mem_pools_young_max_in_bytes": 279183360, "mem_pools_young_max_in_bytes": float64(279183360),
"jvm_mem_pools_young_peak_used_in_bytes": 71630848, "mem_pools_young_peak_used_in_bytes": float64(71630848),
"jvm_mem_pools_young_peak_max_in_bytes": 279183360, "mem_pools_young_peak_max_in_bytes": float64(279183360),
"jvm_mem_pools_young_used_in_bytes": 32685760, "mem_pools_young_used_in_bytes": float64(32685760),
"jvm_mem_pools_survivor_peak_used_in_bytes": 8912888, "mem_pools_survivor_peak_used_in_bytes": float64(8912888),
"jvm_mem_pools_survivor_peak_max_in_bytes": 34865152, "mem_pools_survivor_peak_max_in_bytes": float64(34865152),
"jvm_mem_pools_survivor_used_in_bytes": 8912880, "mem_pools_survivor_used_in_bytes": float64(8912880),
"jvm_mem_pools_survivor_max_in_bytes": 34865152, "mem_pools_survivor_max_in_bytes": float64(34865152),
"jvm_mem_pools_old_peak_max_in_bytes": 724828160, "mem_pools_old_peak_max_in_bytes": float64(724828160),
"jvm_mem_pools_old_used_in_bytes": 11110928, "mem_pools_old_used_in_bytes": float64(11110928),
"jvm_mem_pools_old_max_in_bytes": 724828160, "mem_pools_old_max_in_bytes": float64(724828160),
"jvm_mem_pools_old_peak_used_in_bytes": 14354608, "mem_pools_old_peak_used_in_bytes": float64(14354608),
"jvm_mem_heap_used_in_bytes": 52709568, "mem_heap_used_in_bytes": float64(52709568),
"jvm_mem_heap_used_percent": 5, "mem_heap_used_percent": float64(5),
"jvm_mem_heap_committed_in_bytes": 259522560, "mem_heap_committed_in_bytes": float64(259522560),
"jvm_mem_heap_max_in_bytes": 1038876672, "mem_heap_max_in_bytes": float64(1038876672),
"jvm_threads_peak_count": 45, "threads_peak_count": float64(45),
"jvm_threads_count": 44, "threads_count": float64(44),
"jvm_gc_collectors_young_collection_count": 2, "gc_collectors_young_collection_count": float64(2),
"jvm_gc_collectors_young_collection_time_in_millis": 98, "gc_collectors_young_collection_time_in_millis": float64(98),
"jvm_gc_collectors_old_collection_count": 1, "gc_collectors_old_collection_count": float64(1),
"jvm_gc_collectors_old_collection_time_in_millis": 24, "gc_collectors_old_collection_time_in_millis": float64(24),
"jvm_buffer_pools_direct_count": 40, "buffer_pools_direct_count": float64(40),
"jvm_buffer_pools_direct_used_in_bytes": 6304239, "buffer_pools_direct_used_in_bytes": float64(6304239),
"jvm_buffer_pools_direct_total_capacity_in_bytes": 6304239, "buffer_pools_direct_total_capacity_in_bytes": float64(6304239),
"jvm_buffer_pools_mapped_count": 0, "buffer_pools_mapped_count": float64(0),
"jvm_buffer_pools_mapped_used_in_bytes": 0, "buffer_pools_mapped_used_in_bytes": float64(0),
"jvm_buffer_pools_mapped_total_capacity_in_bytes": 0, "buffer_pools_mapped_total_capacity_in_bytes": float64(0),
} }
var threadPoolExpected = map[string]float64{ var threadPoolExpected = map[string]interface{}{
"thread_pool_merge_threads": 6, "merge_threads": float64(6),
"thread_pool_merge_queue": 4, "merge_queue": float64(4),
"thread_pool_merge_active": 5, "merge_active": float64(5),
"thread_pool_merge_rejected": 2, "merge_rejected": float64(2),
"thread_pool_merge_largest": 5, "merge_largest": float64(5),
"thread_pool_merge_completed": 1, "merge_completed": float64(1),
"thread_pool_bulk_threads": 4, "bulk_threads": float64(4),
"thread_pool_bulk_queue": 5, "bulk_queue": float64(5),
"thread_pool_bulk_active": 7, "bulk_active": float64(7),
"thread_pool_bulk_rejected": 3, "bulk_rejected": float64(3),
"thread_pool_bulk_largest": 1, "bulk_largest": float64(1),
"thread_pool_bulk_completed": 4, "bulk_completed": float64(4),
"thread_pool_warmer_threads": 2, "warmer_threads": float64(2),
"thread_pool_warmer_queue": 7, "warmer_queue": float64(7),
"thread_pool_warmer_active": 3, "warmer_active": float64(3),
"thread_pool_warmer_rejected": 2, "warmer_rejected": float64(2),
"thread_pool_warmer_largest": 3, "warmer_largest": float64(3),
"thread_pool_warmer_completed": 1, "warmer_completed": float64(1),
"thread_pool_get_largest": 2, "get_largest": float64(2),
"thread_pool_get_completed": 1, "get_completed": float64(1),
"thread_pool_get_threads": 1, "get_threads": float64(1),
"thread_pool_get_queue": 8, "get_queue": float64(8),
"thread_pool_get_active": 4, "get_active": float64(4),
"thread_pool_get_rejected": 3, "get_rejected": float64(3),
"thread_pool_index_threads": 6, "index_threads": float64(6),
"thread_pool_index_queue": 8, "index_queue": float64(8),
"thread_pool_index_active": 4, "index_active": float64(4),
"thread_pool_index_rejected": 2, "index_rejected": float64(2),
"thread_pool_index_largest": 3, "index_largest": float64(3),
"thread_pool_index_completed": 6, "index_completed": float64(6),
"thread_pool_suggest_threads": 2, "suggest_threads": float64(2),
"thread_pool_suggest_queue": 7, "suggest_queue": float64(7),
"thread_pool_suggest_active": 2, "suggest_active": float64(2),
"thread_pool_suggest_rejected": 1, "suggest_rejected": float64(1),
"thread_pool_suggest_largest": 8, "suggest_largest": float64(8),
"thread_pool_suggest_completed": 3, "suggest_completed": float64(3),
"thread_pool_fetch_shard_store_queue": 7, "fetch_shard_store_queue": float64(7),
"thread_pool_fetch_shard_store_active": 4, "fetch_shard_store_active": float64(4),
"thread_pool_fetch_shard_store_rejected": 2, "fetch_shard_store_rejected": float64(2),
"thread_pool_fetch_shard_store_largest": 4, "fetch_shard_store_largest": float64(4),
"thread_pool_fetch_shard_store_completed": 1, "fetch_shard_store_completed": float64(1),
"thread_pool_fetch_shard_store_threads": 1, "fetch_shard_store_threads": float64(1),
"thread_pool_management_threads": 2, "management_threads": float64(2),
"thread_pool_management_queue": 3, "management_queue": float64(3),
"thread_pool_management_active": 1, "management_active": float64(1),
"thread_pool_management_rejected": 6, "management_rejected": float64(6),
"thread_pool_management_largest": 2, "management_largest": float64(2),
"thread_pool_management_completed": 22, "management_completed": float64(22),
"thread_pool_percolate_queue": 23, "percolate_queue": float64(23),
"thread_pool_percolate_active": 13, "percolate_active": float64(13),
"thread_pool_percolate_rejected": 235, "percolate_rejected": float64(235),
"thread_pool_percolate_largest": 23, "percolate_largest": float64(23),
"thread_pool_percolate_completed": 33, "percolate_completed": float64(33),
"thread_pool_percolate_threads": 123, "percolate_threads": float64(123),
"thread_pool_listener_active": 4, "listener_active": float64(4),
"thread_pool_listener_rejected": 8, "listener_rejected": float64(8),
"thread_pool_listener_largest": 1, "listener_largest": float64(1),
"thread_pool_listener_completed": 1, "listener_completed": float64(1),
"thread_pool_listener_threads": 1, "listener_threads": float64(1),
"thread_pool_listener_queue": 2, "listener_queue": float64(2),
"thread_pool_search_rejected": 7, "search_rejected": float64(7),
"thread_pool_search_largest": 2, "search_largest": float64(2),
"thread_pool_search_completed": 4, "search_completed": float64(4),
"thread_pool_search_threads": 5, "search_threads": float64(5),
"thread_pool_search_queue": 7, "search_queue": float64(7),
"thread_pool_search_active": 2, "search_active": float64(2),
"thread_pool_fetch_shard_started_threads": 3, "fetch_shard_started_threads": float64(3),
"thread_pool_fetch_shard_started_queue": 1, "fetch_shard_started_queue": float64(1),
"thread_pool_fetch_shard_started_active": 5, "fetch_shard_started_active": float64(5),
"thread_pool_fetch_shard_started_rejected": 6, "fetch_shard_started_rejected": float64(6),
"thread_pool_fetch_shard_started_largest": 4, "fetch_shard_started_largest": float64(4),
"thread_pool_fetch_shard_started_completed": 54, "fetch_shard_started_completed": float64(54),
"thread_pool_refresh_rejected": 4, "refresh_rejected": float64(4),
"thread_pool_refresh_largest": 8, "refresh_largest": float64(8),
"thread_pool_refresh_completed": 3, "refresh_completed": float64(3),
"thread_pool_refresh_threads": 23, "refresh_threads": float64(23),
"thread_pool_refresh_queue": 7, "refresh_queue": float64(7),
"thread_pool_refresh_active": 3, "refresh_active": float64(3),
"thread_pool_optimize_threads": 3, "optimize_threads": float64(3),
"thread_pool_optimize_queue": 4, "optimize_queue": float64(4),
"thread_pool_optimize_active": 1, "optimize_active": float64(1),
"thread_pool_optimize_rejected": 2, "optimize_rejected": float64(2),
"thread_pool_optimize_largest": 7, "optimize_largest": float64(7),
"thread_pool_optimize_completed": 3, "optimize_completed": float64(3),
"thread_pool_snapshot_largest": 1, "snapshot_largest": float64(1),
"thread_pool_snapshot_completed": 0, "snapshot_completed": float64(0),
"thread_pool_snapshot_threads": 8, "snapshot_threads": float64(8),
"thread_pool_snapshot_queue": 5, "snapshot_queue": float64(5),
"thread_pool_snapshot_active": 6, "snapshot_active": float64(6),
"thread_pool_snapshot_rejected": 2, "snapshot_rejected": float64(2),
"thread_pool_generic_threads": 1, "generic_threads": float64(1),
"thread_pool_generic_queue": 4, "generic_queue": float64(4),
"thread_pool_generic_active": 6, "generic_active": float64(6),
"thread_pool_generic_rejected": 3, "generic_rejected": float64(3),
"thread_pool_generic_largest": 2, "generic_largest": float64(2),
"thread_pool_generic_completed": 27, "generic_completed": float64(27),
"thread_pool_flush_threads": 3, "flush_threads": float64(3),
"thread_pool_flush_queue": 8, "flush_queue": float64(8),
"thread_pool_flush_active": 0, "flush_active": float64(0),
"thread_pool_flush_rejected": 1, "flush_rejected": float64(1),
"thread_pool_flush_largest": 5, "flush_largest": float64(5),
"thread_pool_flush_completed": 3, "flush_completed": float64(3),
} }
var fsExpected = map[string]float64{ var fsExpected = map[string]interface{}{
"fs_timestamp": 1436460392946, "timestamp": float64(1436460392946),
"fs_total_free_in_bytes": 16909316096, "total_free_in_bytes": float64(16909316096),
"fs_total_available_in_bytes": 15894814720, "total_available_in_bytes": float64(15894814720),
"fs_total_total_in_bytes": 19507089408, "total_total_in_bytes": float64(19507089408),
} }
var transportExpected = map[string]float64{ var transportExpected = map[string]interface{}{
"transport_server_open": 13, "server_open": float64(13),
"transport_rx_count": 6, "rx_count": float64(6),
"transport_rx_size_in_bytes": 1380, "rx_size_in_bytes": float64(1380),
"transport_tx_count": 6, "tx_count": float64(6),
"transport_tx_size_in_bytes": 1380, "tx_size_in_bytes": float64(1380),
} }
var httpExpected = map[string]float64{ var httpExpected = map[string]interface{}{
"http_current_open": 3, "current_open": float64(3),
"http_total_opened": 3, "total_opened": float64(3),
} }
var breakersExpected = map[string]float64{ var breakersExpected = map[string]interface{}{
"breakers_fielddata_estimated_size_in_bytes": 0, "fielddata_estimated_size_in_bytes": float64(0),
"breakers_fielddata_overhead": 1.03, "fielddata_overhead": float64(1.03),
"breakers_fielddata_tripped": 0, "fielddata_tripped": float64(0),
"breakers_fielddata_limit_size_in_bytes": 623326003, "fielddata_limit_size_in_bytes": float64(623326003),
"breakers_request_estimated_size_in_bytes": 0, "request_estimated_size_in_bytes": float64(0),
"breakers_request_overhead": 1.0, "request_overhead": float64(1.0),
"breakers_request_tripped": 0, "request_tripped": float64(0),
"breakers_request_limit_size_in_bytes": 415550668, "request_limit_size_in_bytes": float64(415550668),
"breakers_parent_overhead": 1.0, "parent_overhead": float64(1.0),
"breakers_parent_tripped": 0, "parent_tripped": float64(0),
"breakers_parent_limit_size_in_bytes": 727213670, "parent_limit_size_in_bytes": float64(727213670),
"breakers_parent_estimated_size_in_bytes": 0, "parent_estimated_size_in_bytes": float64(0),
} }