github.com/go-graphite/carbonapi@v0.17.0/zipper/protocols/victoriametrics/feature_set_test.go (about) 1 package victoriametrics 2 3 import ( 4 "testing" 5 ) 6 7 type parseVMVersionTest struct { 8 name string 9 input []byte 10 expectedVer string 11 fallbackVer string 12 } 13 14 func TestParseVMVersion_test(t *testing.T) { 15 tests := []parseVMVersionTest{ 16 { 17 name: "full output from 1.46.0", 18 input: []byte("vm_active_force_merges 0\nvm_active_merges{type=\"indexdb\"} 0\nvm_active_merges{type=\"storage/big\"} 0\nvm_active_merges{type=\"storage/small\"} 0\nvm_assisted_merges_total{type=\"indexdb\"} 0\nvm_assisted_merges_total{type=\"storage/small\"} 0\nvm_blocks{type=\"indexdb\"} 17\nvm_blocks{type=\"storage/big\"} 0\nvm_blocks{type=\"storage/small\"} 4366\nvm_cache_collisions_total{type=\"storage/metricName\"} 0\nvm_cache_collisions_total{type=\"storage/tsid\"} 0\nvm_cache_entries{type=\"indexdb/dataBlocks\"} 0\nvm_cache_entries{type=\"indexdb/indexBlocks\"} 0\nvm_cache_entries{type=\"indexdb/tagFilters\"} 0\nvm_cache_entries{type=\"indexdb/uselessTagFilters\"} 0\nvm_cache_entries{type=\"promql/parse\"} 0\nvm_cache_entries{type=\"promql/regexp\"} 0\nvm_cache_entries{type=\"promql/rollupResult\"} 0\nvm_cache_entries{type=\"storage/bigIndexBlocks\"} 0\nvm_cache_entries{type=\"storage/date_metricID\"} 0\nvm_cache_entries{type=\"storage/hour_metric_ids\"} 0\nvm_cache_entries{type=\"storage/metricIDs\"} 0\nvm_cache_entries{type=\"storage/metricName\"} 0\nvm_cache_entries{type=\"storage/next_day_metric_ids\"} 0\nvm_cache_entries{type=\"storage/prefetchedMetricIDs\"} 0\nvm_cache_entries{type=\"storage/regexps\"} 0\nvm_cache_entries{type=\"storage/smallIndexBlocks\"} 0\nvm_cache_entries{type=\"storage/tsid\"} 0\nvm_cache_misses_total{type=\"indexdb/dataBlocks\"} 0\nvm_cache_misses_total{type=\"indexdb/indexBlocks\"} 0\nvm_cache_misses_total{type=\"indexdb/tagFilters\"} 0\nvm_cache_misses_total{type=\"indexdb/uselessTagFilters\"} 0\nvm_cache_misses_total{type=\"promql/parse\"} 0\nvm_cache_misses_total{type=\"promql/regexp\"} 0\nvm_cache_misses_total{type=\"promql/rollupResult\"} 0\nvm_cache_misses_total{type=\"storage/bigIndexBlocks\"} 0\nvm_cache_misses_total{type=\"storage/metricIDs\"} 0\nvm_cache_misses_total{type=\"storage/metricName\"} 0\nvm_cache_misses_total{type=\"storage/regexps\"} 0\nvm_cache_misses_total{type=\"storage/smallIndexBlocks\"} 0\nvm_cache_misses_total{type=\"storage/tsid\"} 0\nvm_cache_requests_total{type=\"indexdb/dataBlocks\"} 0\nvm_cache_requests_total{type=\"indexdb/indexBlocks\"} 0\nvm_cache_requests_total{type=\"indexdb/tagFilters\"} 0\nvm_cache_requests_total{type=\"indexdb/uselessTagFilters\"} 0\nvm_cache_requests_total{type=\"promql/parse\"} 0\nvm_cache_requests_total{type=\"promql/regexp\"} 0\nvm_cache_requests_total{type=\"promql/rollupResult\"} 0\nvm_cache_requests_total{type=\"storage/bigIndexBlocks\"} 0\nvm_cache_requests_total{type=\"storage/metricIDs\"} 0\nvm_cache_requests_total{type=\"storage/metricName\"} 0\nvm_cache_requests_total{type=\"storage/regexps\"} 0\nvm_cache_requests_total{type=\"storage/smallIndexBlocks\"} 0\nvm_cache_requests_total{type=\"storage/tsid\"} 0\nvm_cache_resets_total{type=\"promql/rollupResult\"} 0\nvm_cache_size_bytes{type=\"indexdb/tagFilters\"} 0\nvm_cache_size_bytes{type=\"indexdb/uselessTagFilters\"} 0\nvm_cache_size_bytes{type=\"promql/rollupResult\"} 0\nvm_cache_size_bytes{type=\"storage/date_metricID\"} 0\nvm_cache_size_bytes{type=\"storage/hour_metric_ids\"} 176\nvm_cache_size_bytes{type=\"storage/metricIDs\"} 0\nvm_cache_size_bytes{type=\"storage/metricName\"} 0\nvm_cache_size_bytes{type=\"storage/next_day_metric_ids\"} 88\nvm_cache_size_bytes{type=\"storage/prefetchedMetricIDs\"} 88\nvm_cache_size_bytes{type=\"storage/tsid\"} 0\nvm_concurrent_addrows_capacity 24\nvm_concurrent_addrows_current 0\nvm_concurrent_addrows_dropped_rows_total 0\nvm_concurrent_addrows_limit_reached_total 0\nvm_concurrent_addrows_limit_timeout_total 0\nvm_concurrent_insert_capacity 96\nvm_concurrent_insert_current 0\nvm_concurrent_insert_limit_reached_total 0\nvm_concurrent_insert_limit_timeout_total 0\nvm_concurrent_search_tsids_capacity 48\nvm_concurrent_search_tsids_current 0\nvm_concurrent_search_tsids_limit_reached_total 0\nvm_concurrent_search_tsids_limit_timeout_total 0\nvm_concurrent_select_capacity 16\nvm_concurrent_select_current 0\nvm_concurrent_select_limit_reached_total 0\nvm_concurrent_select_limit_timeout_total 0\nvm_data_size_bytes{type=\"indexdb\"} 103443\nvm_data_size_bytes{type=\"storage/big\"} 0\nvm_data_size_bytes{type=\"storage/small\"} 1191577\nvm_date_metric_id_cache_resets_total 1\nvm_date_metric_id_cache_syncs_total 0\nvm_date_metric_ids_search_calls_total 0\nvm_date_metric_ids_search_hits_total 0\nvm_date_range_hits_total 0\nvm_date_range_search_calls_total 0\nvm_deduplicated_samples_total{type=\"merge\"} 0\nvm_deduplicated_samples_total{type=\"select\"} 0\nvm_deleted_metrics_total{type=\"indexdb\"} 0\nvm_filestream_buffered_read_bytes_total 644\nvm_filestream_buffered_read_calls_total 18\nvm_filestream_buffered_write_calls_total 0\nvm_filestream_buffered_written_bytes_total 0\nvm_filestream_readers 0\nvm_filestream_real_read_bytes_total 644\nvm_filestream_real_read_calls_total 18\nvm_filestream_real_write_calls_total 0\nvm_filestream_real_written_bytes_total 0\nvm_filestream_writers 0\nvm_free_disk_space_bytes{path=\"/home/civil/graphite/victoria-metrics-data\"} 74603311104\nvm_fs_read_bytes_total 17689\nvm_fs_read_calls_total 12\nvm_fs_readers 27\nvm_http_conn_timeout_closed_conns_total 0\nvm_http_request_duration_seconds_bucket{path=\"/metrics\",vmrange=\"7.5e-4...8.0e-4\"} 1\nvm_http_request_duration_seconds_sum{path=\"/metrics\"} 0.000773919\nvm_http_request_duration_seconds_count{path=\"/metrics\"} 1\nvm_http_request_errors_total{path=\"*\", reason=\"unsupported\"} 0\nvm_http_request_errors_total{path=\"/api/v1/admin/tsdb/delete_series\"} 0\nvm_http_request_errors_total{path=\"/api/v1/export\"} 0\nvm_http_request_errors_total{path=\"/api/v1/export/csv\"} 0\nvm_http_request_errors_total{path=\"/api/v1/export/native\"} 0\nvm_http_request_errors_total{path=\"/api/v1/import\", protocol=\"vmimport\"} 0\nvm_http_request_errors_total{path=\"/api/v1/import/csv\", protocol=\"csvimport\"} 0\nvm_http_request_errors_total{path=\"/api/v1/import/native\", protocol=\"nativeimport\"} 0\nvm_http_request_errors_total{path=\"/api/v1/import/prometheus\", protocol=\"prometheusimport\"} 0\nvm_http_request_errors_total{path=\"/api/v1/label/{}/values\"} 0\nvm_http_request_errors_total{path=\"/api/v1/labels\"} 0\nvm_http_request_errors_total{path=\"/api/v1/labels/count\"} 0\nvm_http_request_errors_total{path=\"/api/v1/query\"} 0\nvm_http_request_errors_total{path=\"/api/v1/query_range\"} 0\nvm_http_request_errors_total{path=\"/api/v1/series\"} 0\nvm_http_request_errors_total{path=\"/api/v1/series/count\"} 0\nvm_http_request_errors_total{path=\"/api/v1/status/tsdb\"} 0\nvm_http_request_errors_total{path=\"/api/v1/write\", protocol=\"promremotewrite\"} 0\nvm_http_request_errors_total{path=\"/federate\"} 0\nvm_http_request_errors_total{path=\"/metrics/expand\"} 0\nvm_http_request_errors_total{path=\"/metrics/find\"} 0\nvm_http_request_errors_total{path=\"/metrics/index.json\"} 0\nvm_http_request_errors_total{path=\"/write\", protocol=\"influx\"} 0\nvm_http_requests_all_total 4\nvm_http_requests_total{path=\"/-/reload\"} 0\nvm_http_requests_total{path=\"/api/v1/admin/tsdb/delete_series\"} 0\nvm_http_requests_total{path=\"/api/v1/alerts\"} 0\nvm_http_requests_total{path=\"/api/v1/export\"} 0\nvm_http_requests_total{path=\"/api/v1/export/csv\"} 0\nvm_http_requests_total{path=\"/api/v1/export/native\"} 0\nvm_http_requests_total{path=\"/api/v1/import\", protocol=\"vmimport\"} 0\nvm_http_requests_total{path=\"/api/v1/import/csv\", protocol=\"csvimport\"} 0\nvm_http_requests_total{path=\"/api/v1/import/native\", protocol=\"nativeimport\"} 0\nvm_http_requests_total{path=\"/api/v1/import/prometheus\", protocol=\"prometheusimport\"} 0\nvm_http_requests_total{path=\"/api/v1/label/{}/values\"} 0\nvm_http_requests_total{path=\"/api/v1/labels\"} 0\nvm_http_requests_total{path=\"/api/v1/labels/count\"} 0\nvm_http_requests_total{path=\"/api/v1/metadata\"} 0\nvm_http_requests_total{path=\"/api/v1/query\"} 0\nvm_http_requests_total{path=\"/api/v1/query_range\"} 0\nvm_http_requests_total{path=\"/api/v1/rules\"} 0\nvm_http_requests_total{path=\"/api/v1/series\"} 0\nvm_http_requests_total{path=\"/api/v1/series/count\"} 0\nvm_http_requests_total{path=\"/api/v1/status/active_queries\"} 0\nvm_http_requests_total{path=\"/api/v1/status/tsdb\"} 2\nvm_http_requests_total{path=\"/api/v1/targets\"} 0\nvm_http_requests_total{path=\"/api/v1/write\", protocol=\"promremotewrite\"} 0\nvm_http_requests_total{path=\"/debug/pprof/\"} 0\nvm_http_requests_total{path=\"/debug/pprof/cmdline\"} 0\nvm_http_requests_total{path=\"/debug/pprof/default\"} 0\nvm_http_requests_total{path=\"/debug/pprof/mutex\"} 0\nvm_http_requests_total{path=\"/debug/pprof/profile\"} 0\nvm_http_requests_total{path=\"/debug/pprof/symbol\"} 0\nvm_http_requests_total{path=\"/debug/pprof/trace\"} 0\nvm_http_requests_total{path=\"/favicon.ico\"} 0\nvm_http_requests_total{path=\"/federate\"} 0\nvm_http_requests_total{path=\"/metrics\"} 2\nvm_http_requests_total{path=\"/metrics/expand\"} 0\nvm_http_requests_total{path=\"/metrics/find\"} 0\nvm_http_requests_total{path=\"/metrics/index.json\"} 0\nvm_http_requests_total{path=\"/query\", protocol=\"influx\"} 0\nvm_http_requests_total{path=\"/targets\"} 0\nvm_http_requests_total{path=\"/write\", protocol=\"influx\"} 0\nvm_index_blocks_with_metric_ids_incorrect_order_total 0\nvm_index_blocks_with_metric_ids_processed_total 0\nvm_ingestserver_request_errors_total{type=\"graphite\", name=\"write\", net=\"tcp\"} 0\nvm_ingestserver_request_errors_total{type=\"graphite\", name=\"write\", net=\"udp\"} 0\nvm_ingestserver_request_errors_total{type=\"influx\", name=\"write\", net=\"tcp\"} 0\nvm_ingestserver_request_errors_total{type=\"influx\", name=\"write\", net=\"udp\"} 0\nvm_ingestserver_request_errors_total{type=\"opentsdb\", name=\"write\", net=\"tcp\"} 0\nvm_ingestserver_request_errors_total{type=\"opentsdb\", name=\"write\", net=\"udp\"} 0\nvm_ingestserver_request_errors_total{type=\"opentsdbhttp\", name=\"write\", net=\"tcp\"} 0\nvm_ingestserver_requests_total{type=\"graphite\", name=\"write\", net=\"tcp\"} 0\nvm_ingestserver_requests_total{type=\"graphite\", name=\"write\", net=\"udp\"} 0\nvm_ingestserver_requests_total{type=\"influx\", name=\"write\", net=\"tcp\"} 0\nvm_ingestserver_requests_total{type=\"influx\", name=\"write\", net=\"udp\"} 0\nvm_ingestserver_requests_total{type=\"opentsdb\", name=\"write\", net=\"tcp\"} 0\nvm_ingestserver_requests_total{type=\"opentsdb\", name=\"write\", net=\"udp\"} 0\nvm_ingestserver_requests_total{type=\"opentsdbhttp\", name=\"write\", net=\"tcp\"} 0\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/app/victoria-metrics/main.go:37\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/app/victoria-metrics/main.go:46\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/app/vmselect/promql/rollup_result_cache.go:56\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/app/vmselect/promql/rollup_result_cache.go:82\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/app/vmstorage/main.go:76\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/app/vmstorage/main.go:92\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/httpserver/httpserver.go:82\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/httpserver/httpserver.go:83\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/ingestserver/graphite/server.go:40\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/ingestserver/graphite/server.go:46\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/logger/flag.go:12\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/logger/flag.go:13\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/logger/flag.go:20\"} 99\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/memory/memory.go:43\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/mergeset/table.go:169\"} 2\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/mergeset/table.go:203\"} 2\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/storage/partition.go:1439\"} 5\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/storage/storage.go:606\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/storage/storage.go:626\"} 1\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/storage/storage.go:650\"} 2\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/storage/storage.go:672\"} 2\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/storage/storage.go:762\"} 3\nvm_log_messages_total{app_version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", level=\"info\", location=\"VictoriaMetrics/lib/storage/storage.go:767\"} 3\nvm_merge_need_free_disk_space{type=\"storage/big\"} 0\nvm_merge_need_free_disk_space{type=\"storage/small\"} 0\nvm_merges_total{type=\"indexdb\"} 0\nvm_merges_total{type=\"storage/big\"} 0\nvm_merges_total{type=\"storage/small\"} 0\nvm_metric_rows_skipped_total{name=\"vmselect\"} 0\nvm_metrics_with_dropped_labels_total 0\nvm_missing_metric_names_for_metric_id_total 0\nvm_missing_tsids_for_metric_id_total 0\nvm_new_timeseries_created_total 0\nvm_nfs_dir_remove_failed_attempts_total 0\nvm_nfs_pending_dirs_to_remove 0\nvm_parts{type=\"indexdb\"} 4\nvm_parts{type=\"storage/big\"} 0\nvm_parts{type=\"storage/small\"} 5\nvm_pending_rows{type=\"indexdb\"} 0\nvm_pending_rows{type=\"storage\"} 0\nvm_promscrape_config_reloads_total 0\nvm_promscrape_conn_bytes_read_total 0\nvm_promscrape_conn_bytes_written_total 0\nvm_promscrape_conn_read_errors_total 0\nvm_promscrape_conn_reads_total 0\nvm_promscrape_conn_write_errors_total 0\nvm_promscrape_conn_writes_total 0\nvm_promscrape_conns 0\nvm_promscrape_dial_errors_total 0\nvm_promscrape_dials_total 0\nvm_promscrape_scrapes_failed_total 0\nvm_promscrape_scrapes_gunzip_failed_total 0\nvm_promscrape_scrapes_gunziped_total 0\nvm_promscrape_scrapes_skipped_by_sample_limit_total 0\nvm_promscrape_scrapes_timed_out_total 0\nvm_promscrape_scrapes_total{status_code=\"200\"} 0\nvm_protoparser_blocks_read_total{type=\"native\"} 0\nvm_protoparser_parse_errors_total{type=\"native\"} 0\nvm_protoparser_process_errors_total{type=\"native\"} 0\nvm_protoparser_read_calls_total{type=\"csvimport\"} 0\nvm_protoparser_read_calls_total{type=\"graphite\"} 0\nvm_protoparser_read_calls_total{type=\"influx\"} 0\nvm_protoparser_read_calls_total{type=\"native\"} 0\nvm_protoparser_read_calls_total{type=\"opentsdb\"} 0\nvm_protoparser_read_calls_total{type=\"opentsdbhttp\"} 0\nvm_protoparser_read_calls_total{type=\"prometheus\"} 0\nvm_protoparser_read_calls_total{type=\"promremotewrite\"} 0\nvm_protoparser_read_calls_total{type=\"vmimport\"} 0\nvm_protoparser_read_errors_total{type=\"csvimport\"} 0\nvm_protoparser_read_errors_total{type=\"graphite\"} 0\nvm_protoparser_read_errors_total{type=\"influx\"} 0\nvm_protoparser_read_errors_total{type=\"native\"} 0\nvm_protoparser_read_errors_total{type=\"opentsdb\"} 0\nvm_protoparser_read_errors_total{type=\"opentsdbhttp\"} 0\nvm_protoparser_read_errors_total{type=\"prometheus\"} 0\nvm_protoparser_read_errors_total{type=\"promremotewrite\"} 0\nvm_protoparser_read_errors_total{type=\"vmimport\"} 0\nvm_protoparser_rows_read_total{type=\"csvimport\"} 0\nvm_protoparser_rows_read_total{type=\"graphite\"} 0\nvm_protoparser_rows_read_total{type=\"influx\"} 0\nvm_protoparser_rows_read_total{type=\"native\"} 0\nvm_protoparser_rows_read_total{type=\"opentsdb\"} 0\nvm_protoparser_rows_read_total{type=\"opentsdbhttp\"} 0\nvm_protoparser_rows_read_total{type=\"prometheus\"} 0\nvm_protoparser_rows_read_total{type=\"promremotewrite\"} 0\nvm_protoparser_rows_read_total{type=\"promscrape\"} 0\nvm_protoparser_rows_read_total{type=\"vmimport\"} 0\nvm_protoparser_unmarshal_errors_total{type=\"opentsdbhttp\"} 0\nvm_protoparser_unmarshal_errors_total{type=\"promremotewrite\"} 0\nvm_references{type=\"indexdb\", name=\"objects\"} 3\nvm_references{type=\"indexdb\", name=\"parts\"} 4\nvm_references{type=\"storage\", name=\"partitions\"} 1\nvm_references{type=\"storage/big\", name=\"parts\"} 0\nvm_references{type=\"storage/small\", name=\"parts\"} 5\nvm_relabel_metrics_dropped_total 0\nvm_request_duration_seconds_sum{path=\"/api/v1/status/tsdb\"} 0.0005675270000000001\nvm_request_duration_seconds_count{path=\"/api/v1/status/tsdb\"} 2\nvm_rollup_result_cache_full_hits_total 0\nvm_rollup_result_cache_miss_total 0\nvm_rollup_result_cache_partial_hits_total 0\nvm_rows_added_to_storage_total 0\nvm_rows_deleted_total{type=\"storage/big\"} 0\nvm_rows_deleted_total{type=\"storage/small\"} 0\nvm_rows_ignored_total{reason=\"big_timestamp\"} 0\nvm_rows_ignored_total{reason=\"small_timestamp\"} 0\nvm_rows_inserted_total{type=\"csvimport\"} 0\nvm_rows_inserted_total{type=\"graphite\"} 0\nvm_rows_inserted_total{type=\"influx\"} 0\nvm_rows_inserted_total{type=\"native\"} 0\nvm_rows_inserted_total{type=\"opentsdb\"} 0\nvm_rows_inserted_total{type=\"opentsdbhttp\"} 0\nvm_rows_inserted_total{type=\"prometheus\"} 0\nvm_rows_inserted_total{type=\"promremotewrite\"} 0\nvm_rows_inserted_total{type=\"promscrape\"} 0\nvm_rows_inserted_total{type=\"vmimport\"} 0\nvm_rows_invalid_total{type=\"csvimport\"} 0\nvm_rows_invalid_total{type=\"graphite\"} 0\nvm_rows_invalid_total{type=\"influx\"} 0\nvm_rows_invalid_total{type=\"opentsdb\"} 0\nvm_rows_invalid_total{type=\"opentsdbhttp\"} 0\nvm_rows_invalid_total{type=\"prometheus\"} 0\nvm_rows_invalid_total{type=\"vmimport\"} 0\nvm_rows_merged_total{type=\"indexdb\"} 0\nvm_rows_merged_total{type=\"storage/big\"} 0\nvm_rows_merged_total{type=\"storage/small\"} 0\nvm_rows{type=\"indexdb\"} 15819\nvm_rows{type=\"storage/big\"} 0\nvm_rows{type=\"storage/small\"} 674704\nvm_search_delays_total 0\nvm_slow_metric_name_loads_total 0\nvm_slow_per_day_index_inserts_total 0\nvm_slow_queries_total 0\nvm_slow_row_inserts_total 0\nvm_tcplistener_accepts_total{name=\"graphite\", addr=\"127.0.0.1:2003\"} 0\nvm_tcplistener_accepts_total{name=\"http\", addr=\":8428\"} 4\nvm_tcplistener_conns{name=\"graphite\", addr=\"127.0.0.1:2003\"} 0\nvm_tcplistener_conns{name=\"http\", addr=\":8428\"} 1\nvm_tcplistener_errors_total{name=\"graphite\", addr=\"127.0.0.1:2003\", type=\"accept\"} 0\nvm_tcplistener_errors_total{name=\"graphite\", addr=\"127.0.0.1:2003\", type=\"close\"} 0\nvm_tcplistener_errors_total{name=\"graphite\", addr=\"127.0.0.1:2003\", type=\"read\"} 0\nvm_tcplistener_errors_total{name=\"graphite\", addr=\"127.0.0.1:2003\", type=\"write\"} 0\nvm_tcplistener_errors_total{name=\"http\", addr=\":8428\", type=\"accept\"} 0\nvm_tcplistener_errors_total{name=\"http\", addr=\":8428\", type=\"close\"} 0\nvm_tcplistener_errors_total{name=\"http\", addr=\":8428\", type=\"read\"} 0\nvm_tcplistener_errors_total{name=\"http\", addr=\":8428\", type=\"write\"} 0\nvm_tcplistener_read_bytes_total{name=\"graphite\", addr=\"127.0.0.1:2003\"} 0\nvm_tcplistener_read_bytes_total{name=\"http\", addr=\":8428\"} 614\nvm_tcplistener_read_calls_total{name=\"graphite\", addr=\"127.0.0.1:2003\"} 0\nvm_tcplistener_read_calls_total{name=\"http\", addr=\":8428\"} 10\nvm_tcplistener_read_timeouts_total{name=\"graphite\", addr=\"127.0.0.1:2003\"} 0\nvm_tcplistener_read_timeouts_total{name=\"http\", addr=\":8428\"} 3\nvm_tcplistener_write_calls_total{name=\"graphite\", addr=\"127.0.0.1:2003\"} 0\nvm_tcplistener_write_calls_total{name=\"http\", addr=\":8428\"} 6\nvm_tcplistener_write_timeouts_total{name=\"graphite\", addr=\"127.0.0.1:2003\"} 0\nvm_tcplistener_write_timeouts_total{name=\"http\", addr=\":8428\"} 0\nvm_tcplistener_written_bytes_total{name=\"graphite\", addr=\"127.0.0.1:2003\"} 0\nvm_tcplistener_written_bytes_total{name=\"http\", addr=\":8428\"} 28726\nvm_timestamps_blocks_merged_total 0\nvm_timestamps_bytes_saved_total 0\nvm_tmp_blocks_files_created_total 0\nvm_tmp_blocks_files_directory_free_bytes 74603311104\nvm_tmp_blocks_max_inmemory_file_size_bytes 4194304\nvm_too_big_rollup_results_total 0\nvm_too_long_label_names_total 0\nvm_too_long_label_values_total 0\nvm_zstd_block_compress_calls_total 0\nvm_zstd_block_compressed_bytes_total 0\nvm_zstd_block_decompress_calls_total 21\nvm_zstd_block_original_bytes_total 0\ngo_memstats_alloc_bytes 151080248\ngo_memstats_alloc_bytes_total 2306908096\ngo_memstats_buck_hash_sys_bytes 1453837\ngo_memstats_frees_total 10292272\ngo_memstats_gc_cpu_fraction 2.348823157227501e-06\ngo_memstats_gc_sys_bytes 11365056\ngo_memstats_heap_alloc_bytes 151080248\ngo_memstats_heap_idle_bytes 113426432\ngo_memstats_heap_inuse_bytes 152911872\ngo_memstats_heap_objects 64495\ngo_memstats_heap_released_bytes 42975232\ngo_memstats_heap_sys_bytes 266338304\ngo_memstats_last_gc_time_seconds 1.6072782551865592e+09\ngo_memstats_lookups_total 0\ngo_memstats_mallocs_total 10356767\ngo_memstats_mcache_inuse_bytes 41664\ngo_memstats_mcache_sys_bytes 49152\ngo_memstats_mspan_inuse_bytes 302192\ngo_memstats_mspan_sys_bytes 425984\ngo_memstats_next_gc_bytes 274701600\ngo_memstats_other_sys_bytes 4886091\ngo_memstats_stack_inuse_bytes 2097152\ngo_memstats_stack_sys_bytes 2097152\ngo_memstats_sys_bytes 286615576\ngo_cgo_calls_count 60\ngo_cpu_count 24\ngo_gc_duration_seconds{quantile=\"0\"} 0\ngo_gc_duration_seconds{quantile=\"0.25\"} 0\ngo_gc_duration_seconds{quantile=\"0.5\"} 0\ngo_gc_duration_seconds{quantile=\"0.75\"} 3.657e-05\ngo_gc_duration_seconds{quantile=\"1\"} 0.000559399\ngo_gc_duration_seconds_sum 0.005397497\ngo_gc_duration_seconds_count 84\ngo_gc_forced_count 0\ngo_gomaxprocs 24\ngo_goroutines 251\ngo_threads 31\ngo_info{version=\"go1.15.3\"} 1\ngo_info_ext{compiler=\"gc\", GOARCH=\"amd64\", GOOS=\"linux\", GOROOT=\"/usr/lib/go\"} 1\nprocess_cpu_seconds_system_total 7.27\nprocess_cpu_seconds_total 20\nprocess_cpu_seconds_user_total 12.73\nprocess_major_pagefaults_total 191\nprocess_minor_pagefaults_total 68970\nprocess_num_threads 30\nprocess_resident_memory_bytes 284422144\nprocess_start_time_seconds 1607269249\nprocess_virtual_memory_bytes 3207864320\nvm_app_version{version=\"victoria-metrics-20201109-230848-tags-v1.46.0-0-g41813eb8\", short_version=\"v1.46.0\"} 1\nvm_allowed_memory_bytes 20197038489\nvm_app_start_timestamp 1607269249\nvm_app_uptime_seconds 9036\nflag{name=\"bigMergeConcurrency\", value=\"0\"} 1\nflag{name=\"csvTrimTimestamp\", value=\"1ms\"} 1\nflag{name=\"dedup.minScrapeInterval\", value=\"0s\"} 1\nflag{name=\"deleteAuthKey\", value=\"secret\"} 1\nflag{name=\"denyQueriesOutsideRetention\", value=\"false\"} 1\nflag{name=\"enableTCP6\", value=\"false\"} 1\nflag{name=\"envflag.enable\", value=\"false\"} 1\nflag{name=\"envflag.prefix\", value=\"\"} 1\nflag{name=\"finalMergeDelay\", value=\"30s\"} 1\nflag{name=\"forceMergeAuthKey\", value=\"secret\"} 1\nflag{name=\"fs.disableMmap\", value=\"false\"} 1\nflag{name=\"graphiteListenAddr\", value=\"127.0.0.1:2003\"} 1\nflag{name=\"graphiteTrimTimestamp\", value=\"1s\"} 1\nflag{name=\"http.connTimeout\", value=\"2m0s\"} 1\nflag{name=\"http.disableResponseCompression\", value=\"false\"} 1\nflag{name=\"http.idleConnTimeout\", value=\"1m0s\"} 1\nflag{name=\"http.maxGracefulShutdownDuration\", value=\"7s\"} 1\nflag{name=\"http.pathPrefix\", value=\"\"} 1\nflag{name=\"http.shutdownDelay\", value=\"0s\"} 1\nflag{name=\"httpAuth.password\", value=\"secret\"} 1\nflag{name=\"httpAuth.username\", value=\"\"} 1\nflag{name=\"httpListenAddr\", value=\":8428\"} 1\nflag{name=\"import.maxLineLen\", value=\"104857600\"} 1\nflag{name=\"influx.maxLineSize\", value=\"262144\"} 1\nflag{name=\"influxListenAddr\", value=\"\"} 1\nflag{name=\"influxMeasurementFieldSeparator\", value=\"_\"} 1\nflag{name=\"influxSkipMeasurement\", value=\"false\"} 1\nflag{name=\"influxSkipSingleField\", value=\"false\"} 1\nflag{name=\"influxTrimTimestamp\", value=\"1ms\"} 1\nflag{name=\"insert.maxQueueDuration\", value=\"1m0s\"} 1\nflag{name=\"loggerDisableTimestamps\", value=\"false\"} 1\nflag{name=\"loggerErrorsPerSecondLimit\", value=\"10\"} 1\nflag{name=\"loggerFormat\", value=\"default\"} 1\nflag{name=\"loggerLevel\", value=\"INFO\"} 1\nflag{name=\"loggerOutput\", value=\"stderr\"} 1\nflag{name=\"maxConcurrentInserts\", value=\"96\"} 1\nflag{name=\"maxInsertRequestSize\", value=\"33554432\"} 1\nflag{name=\"maxLabelsPerTimeseries\", value=\"30\"} 1\nflag{name=\"memory.allowedBytes\", value=\"0\"} 1\nflag{name=\"memory.allowedPercent\", value=\"60\"} 1\nflag{name=\"metricsAuthKey\", value=\"secret\"} 1\nflag{name=\"opentsdbHTTPListenAddr\", value=\"\"} 1\nflag{name=\"opentsdbListenAddr\", value=\"\"} 1\nflag{name=\"opentsdbTrimTimestamp\", value=\"1s\"} 1\nflag{name=\"opentsdbhttp.maxInsertRequestSize\", value=\"33554432\"} 1\nflag{name=\"opentsdbhttpTrimTimestamp\", value=\"1ms\"} 1\nflag{name=\"pprofAuthKey\", value=\"secret\"} 1\nflag{name=\"precisionBits\", value=\"64\"} 1\nflag{name=\"promscrape.config\", value=\"\"} 1\nflag{name=\"promscrape.config.dryRun\", value=\"false\"} 1\nflag{name=\"promscrape.config.strictParse\", value=\"false\"} 1\nflag{name=\"promscrape.configCheckInterval\", value=\"0s\"} 1\nflag{name=\"promscrape.consulSDCheckInterval\", value=\"30s\"} 1\nflag{name=\"promscrape.disableCompression\", value=\"false\"} 1\nflag{name=\"promscrape.disableKeepAlive\", value=\"false\"} 1\nflag{name=\"promscrape.discovery.concurrency\", value=\"100\"} 1\nflag{name=\"promscrape.discovery.concurrentWaitTime\", value=\"1m0s\"} 1\nflag{name=\"promscrape.dnsSDCheckInterval\", value=\"30s\"} 1\nflag{name=\"promscrape.dockerswarmSDCheckInterval\", value=\"30s\"} 1\nflag{name=\"promscrape.ec2SDCheckInterval\", value=\"1m0s\"} 1\nflag{name=\"promscrape.fileSDCheckInterval\", value=\"30s\"} 1\nflag{name=\"promscrape.gceSDCheckInterval\", value=\"1m0s\"} 1\nflag{name=\"promscrape.kubernetesSDCheckInterval\", value=\"30s\"} 1\nflag{name=\"promscrape.maxDroppedTargets\", value=\"1000\"} 1\nflag{name=\"promscrape.maxScrapeSize\", value=\"16777216\"} 1\nflag{name=\"promscrape.openstackSDCheckInterval\", value=\"30s\"} 1\nflag{name=\"promscrape.streamParse\", value=\"false\"} 1\nflag{name=\"promscrape.suppressDuplicateScrapeTargetErrors\", value=\"false\"} 1\nflag{name=\"promscrape.suppressScrapeErrors\", value=\"false\"} 1\nflag{name=\"relabelConfig\", value=\"\"} 1\nflag{name=\"retentionPeriod\", value=\"1\"} 1\nflag{name=\"search.cacheTimestampOffset\", value=\"5m0s\"} 1\nflag{name=\"search.disableCache\", value=\"false\"} 1\nflag{name=\"search.latencyOffset\", value=\"30s\"} 1\nflag{name=\"search.logSlowQueryDuration\", value=\"5s\"} 1\nflag{name=\"search.maxConcurrentRequests\", value=\"16\"} 1\nflag{name=\"search.maxExportDuration\", value=\"720h0m0s\"} 1\nflag{name=\"search.maxLookback\", value=\"0s\"} 1\nflag{name=\"search.maxPointsPerTimeseries\", value=\"30000\"} 1\nflag{name=\"search.maxQueryDuration\", value=\"30s\"} 1\nflag{name=\"search.maxQueryLen\", value=\"16384\"} 1\nflag{name=\"search.maxQueueDuration\", value=\"10s\"} 1\nflag{name=\"search.maxStalenessInterval\", value=\"0s\"} 1\nflag{name=\"search.maxTagKeys\", value=\"secret\"} 1\nflag{name=\"search.maxTagValueSuffixesPerSearch\", value=\"100000\"} 1\nflag{name=\"search.maxTagValues\", value=\"100000\"} 1\nflag{name=\"search.maxUniqueTimeseries\", value=\"300000\"} 1\nflag{name=\"search.minStalenessInterval\", value=\"0s\"} 1\nflag{name=\"search.resetCacheAuthKey\", value=\"secret\"} 1\nflag{name=\"selfScrapeInstance\", value=\"self\"} 1\nflag{name=\"selfScrapeInterval\", value=\"0s\"} 1\nflag{name=\"selfScrapeJob\", value=\"victoria-metrics\"} 1\nflag{name=\"smallMergeConcurrency\", value=\"0\"} 1\nflag{name=\"snapshotAuthKey\", value=\"secret\"} 1\nflag{name=\"storageDataPath\", value=\"/home/civil/graphite/victoria-metrics-data\"} 1\nflag{name=\"tls\", value=\"false\"} 1\nflag{name=\"tlsCertFile\", value=\"\"} 1\nflag{name=\"tlsKeyFile\", value=\"secret\"} 1\nflag{name=\"version\", value=\"false\"} 1\n"), 19 expectedVer: "v1.46.0", 20 fallbackVer: "v0.0.0", 21 }, 22 { 23 name: "broken output", 24 input: []byte("some random stuff"), 25 expectedVer: "v0.0.0", 26 fallbackVer: "v0.0.0", 27 }, 28 { 29 name: "master version", 30 input: []byte("go_info{version=\"go1.15.5\"} 1\nvm_app_version{version=\"victoria-metrics-20201206-233248-heads-master-0-g007dbf27\", short_version=\"\"} 1\nflag{name=\"version\", value=\"false\"} 1\n"), 31 expectedVer: "v1.50.0", 32 fallbackVer: "v1.50.0", 33 }, 34 } 35 36 for i := range tests { 37 t.Run(tests[i].name, func(t *testing.T) { 38 ver := parseVMVersion(tests[i].input, tests[i].fallbackVer) 39 40 if ver != tests[i].expectedVer { 41 t.Fatalf("failed to parse version, got %v, expected %v", ver, tests[i].expectedVer) 42 } 43 }) 44 } 45 46 }