hawkular-client 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.rdoc +5 -2
- data/lib/hawkular/hawkular_client.rb +1 -1
- data/lib/hawkular/inventory/inventory_api.rb +2 -1
- data/lib/hawkular/metrics/metric_api.rb +4 -1
- data/lib/hawkular/operations/operations_api.rb +7 -4
- data/lib/hawkular/version.rb +1 -1
- data/spec/integration/inventory_spec.rb +516 -466
- data/spec/integration/metric_spec.rb +612 -561
- data/spec/integration/operations_spec.rb +425 -504
- data/spec/spec_helper.rb +73 -19
- data/spec/vcr_cassettes/Inventory/{Connection → NonSecure/Connection/Templates}/Should_err_on_bad_credentials.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{Tenants → NonSecure/Tenants/Templates}/Should_Get_Tenant_For_Explicit_Credentials.yml +13 -9
- data/spec/vcr_cassettes/Inventory/{Tenants → NonSecure/Tenants/Templates}/Should_Get_Tenant_For_Implicit_Credentials.yml +13 -9
- data/spec/vcr_cassettes/Inventory/{inventory_0_17/Templates → NonSecure/inventory_0_17}/Client_should_listen_on_various_inventory_events.json +5 -5
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Client_should_listen_on_various_inventory_events.yml +21 -13
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17/Templates}/Helpers/create_url.yml +12 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Helpers/generate_some_events_for_websocket.yml +51 -37
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17/Templates}/Helpers/get_feeds.yml +11 -9
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_List_datasources_with_no_props.yml +11 -7
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_feed.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_feed_again.yml +16 -10
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +664 -0
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resource.yml +31 -19
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resource_with_metric.yml +77 -49
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_a_resourcetype.yml +16 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_create_and_delete_feed.yml +19 -13
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +420 -0
- data/spec/vcr_cassettes/Inventory/NonSecure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +132 -0
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_have_the_same_requested_metric_type_id.yml +8 -8
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_URLs.yml +29 -7
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_WildFlys.yml +10 -8
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_WildFlys_with_props.yml +24 -17
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_all_the_resource_types.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_children_of_WildFly.yml +31 -13
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_children_of_nested_resource.yml +16 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_feeds.yml +9 -7
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_heap_metrics_for_WildFlys.yml +196 -188
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_for_WildFlys.yml +72 -68
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_of_given_metric_type.yml +12 -44
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_metrics_of_given_resource_type.yml +63 -61
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_operation_definitions_of_given_resource.yml +220 -156
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_operation_definitions_of_given_resource_type.yml +200 -140
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_recursive_children_of_WildFly.yml +30 -12
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_relationships_of_WildFly.yml +129 -113
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_resources_for_feed.yml +12 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_types_with_bad_feed.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_list_types_with_feed.yml +7 -5
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_not_find_an_unknown_resource.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_config_data_of_given_nested_resource.yml +6 -4
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_config_data_of_given_resource.yml +15 -10
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → NonSecure/inventory_0_17}/Templates/Should_return_the_version.yml +8 -6
- data/spec/vcr_cassettes/Inventory/Secure/Connection/Templates/Should_err_on_bad_credentials.yml +44 -0
- data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Explicit_Credentials.yml +101 -0
- data/spec/vcr_cassettes/Inventory/Secure/Tenants/Templates/Should_Get_Tenant_For_Implicit_Credentials.yml +101 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Client_should_listen_on_various_inventory_events.json +47 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Client_should_listen_on_various_inventory_events.yml +207 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/create_url.yml +52 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Helpers/generate_some_events_for_websocket.yml +411 -0
- data/spec/vcr_cassettes/Inventory/{inventory_0_17/Templates/Should_list_feeds_when_using_SSL_without_certificate.yml → Secure/inventory_0_17/Templates/Helpers/get_feeds.yml} +13 -11
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_List_datasources_with_no_props.yml +133 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed.yml +59 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_feed_again.yml +181 -0
- data/spec/vcr_cassettes/Inventory/{inventory_0_17 → Secure/inventory_0_17}/Templates/Should_create_a_nested_resource_and_metric_on_it.yml +108 -150
- data/spec/vcr_cassettes/Inventory/{inventory_0_17/Templates/Should_create_and_get_a_resource.yml → Secure/inventory_0_17/Templates/Should_create_a_resource.yml} +45 -87
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resource_with_metric.yml +846 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_a_resourcetype.yml +169 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_delete_feed.yml +166 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_create_and_get_a_resource.yml +420 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_get_resource_with_its_configurations.yml +132 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_have_the_same_requested_metric_type_id.yml +73 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_URLs.yml +90 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys.yml +70 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_WildFlys_with_props.yml +138 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_all_the_resource_types.yml +59 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_WildFly.yml +333 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_children_of_nested_resource.yml +180 -0
- data/spec/vcr_cassettes/{Operation/Helpers/get_feed.yml → Inventory/Secure/inventory_0_17/Templates/Should_list_feeds.yml} +13 -11
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_heap_metrics_for_WildFlys.yml +943 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_for_WildFlys.yml +361 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_metric_type.yml +90 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_metrics_of_given_resource_type.yml +294 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource.yml +871 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_operation_definitions_of_given_resource_type.yml +740 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_recursive_children_of_WildFly.yml +1117 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_relationships_of_WildFly.yml +393 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_resources_for_feed.yml +84 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_bad_feed.yml +55 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_list_types_with_feed.yml +166 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_not_find_an_unknown_resource.yml +59 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_nested_resource.yml +66 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_config_data_of_given_resource.yml +71 -0
- data/spec/vcr_cassettes/Inventory/Secure/inventory_0_17/Templates/Should_return_the_version.yml +50 -0
- data/spec/vcr_cassettes/Inventory/Templates/Should_list_feeds_when_using_SSL_without_certificate.yml +114 -0
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Get_metric_definition_by_id.yml +10 -8
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Retrieve_metric_rate_points.yml +18 -14
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_Availability_definition.yml +18 -14
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_Counter_definition.yml +18 -14
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_create_gauge_definition.yml +18 -14
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_push_metric_data_to_existing_gauge.yml +9 -7
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_update_tags_for_Availability_definition.yml +28 -22
- data/spec/vcr_cassettes/{Metric_ID_with_special_characters → Metrics/NonSecure/ID_with_special_characters/Templates}/Should_update_tags_for_gauge_definition.yml +28 -22
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +12 -8
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +14 -10
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_group_contiguous_values.yml +10 -6
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +19 -13
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +31 -21
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +14 -10
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +12 -8
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +28 -18
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +38 -24
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +32 -20
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +19 -13
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +14 -10
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +12 -8
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +32 -20
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +19 -13
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_return_periods.yml +10 -6
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +31 -21
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +48 -52
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +39 -25
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +36 -24
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/No_Tenant/Should_fail.yml +6 -4
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Simple/Should_be_Cool.yml +2 -2
- data/spec/vcr_cassettes/Metrics/{metrics_0_16_0 → NonSecure/metrics_0_16_0}/Templates/Status/Should_return_the_version.yml +5 -3
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +3 -3
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +3 -3
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +3 -3
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_return_periods.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Simple/Should_be_Cool.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Status/Should_return_the_version.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_0_8_0 → NonSecure/metrics_0_8_0}/Templates/Tenants/Should_create_and_return_tenant.yml +0 -0
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +19 -15
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +21 -17
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_group_contiguous_values.yml +17 -13
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +29 -23
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +47 -37
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +21 -17
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +19 -15
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +44 -34
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +60 -46
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +51 -39
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +29 -23
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +21 -17
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +19 -15
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +51 -39
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +29 -23
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_return_periods.yml +17 -13
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +50 -0
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +12 -10
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +47 -37
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Mixed_metrics/Should_fetch_rate_stats_for_mixed_metric.yml +328 -0
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +32 -32
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +70 -74
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +61 -47
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +55 -43
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/No_Tenant/Should_fail.yml +9 -7
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Simple/Should_be_Cool.yml +3 -3
- data/spec/vcr_cassettes/Metrics/{metrics_services → NonSecure/metrics_services}/Templates/Status/Should_return_the_version.yml +10 -8
- data/spec/vcr_cassettes/Metrics/NonSecure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Get_metric_definition_by_id.yml +51 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Retrieve_metric_rate_points.yml +92 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Availability_definition.yml +101 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_Counter_definition.yml +101 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_create_gauge_definition.yml +101 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_push_metric_data_to_existing_gauge.yml +50 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_Availability_definition.yml +146 -0
- data/spec/vcr_cassettes/Metrics/Secure/ID_with_special_characters/Templates/Should_update_tags_for_gauge_definition.yml +146 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_group_contiguous_values.yml +97 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +328 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +281 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +281 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_return_periods.yml +97 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +326 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +314 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +285 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/No_Tenant/Should_fail.yml +50 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Simple/Should_be_Cool.yml +48 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Status/Should_return_the_version.yml +44 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_Availability_definition_using_MetricDefinition_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_create_and_return_Availability_using_Hash_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_group_contiguous_values.yml +97 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_push_metric_data_to_non-existing_Availability.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Availability_metrics/Should_update_tags_for_Availability_definition.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_and_return_counter_using_Hash_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_create_counter_definition_using_MetricDefinition_parameter.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_as_bucketed_results.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_get_metrics_with_limit_and_order.yml +328 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_existing_counter.yml +281 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Counter_metrics/Should_push_metric_data_to_non-existing_counter.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_Hash.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_create_gauge_definition_using_MetricDefinition.yml +99 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_existing_gauge.yml +281 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_push_metric_data_to_non-existing_gauge.yml +144 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_periods.yml +97 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +50 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory_def.yml +51 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Gauge_metrics/Should_update_tags_for_gauge_definition.yml +240 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_fetch_stats_for_mixed_metric.yml +364 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_requests_raw_data_for_multiple_metrics.yml +326 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request.yml +314 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Mixed_metrics/Should_send_mixed_metric_request_of_a_single_type.yml +285 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/No_Tenant/Should_fail.yml +50 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Simple/Should_be_Cool.yml +48 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Status/Should_return_the_version.yml +44 -0
- data/spec/vcr_cassettes/Metrics/Secure/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +99 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Helpers/Templates/get_feed.yml +61 -0
- data/spec/vcr_cassettes/Operation/{Helpers → NonSecure/Helpers/Templates}/get_tenant.yml +8 -5
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_JDBC_driver_should_add_the_driver.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Add_datasource_should_be_doable.json +23 -0
- data/spec/vcr_cassettes/Operation/{Operation → NonSecure/Operation}/Add_deployment_should_be_doable.json +4 -7
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +32 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +23 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/{Operation → NonSecure/Operation}/should_not_be_possible_to_perform_on_closed_client.json +1 -1
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +9 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +9 -0
- data/spec/vcr_cassettes/Operation/{Websocket_connection → NonSecure/Websocket_connection}/should_bail_with_no_host.json +0 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established.json +9 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_be_established_via_entrypoint.json +9 -0
- data/spec/vcr_cassettes/Operation/NonSecure/Websocket_connection/should_run_into_error_callback.json +18 -0
- data/spec/vcr_cassettes/Operation/{Websocket_connection → NonSecure/Websocket_connection}/should_run_into_error_callback_because_bad_hash_parameters.json +1 -1
- data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_feed.yml +61 -0
- data/spec/vcr_cassettes/Operation/Secure/Helpers/Templates/get_tenant.yml +55 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_JDBC_driver_should_add_the_driver.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_datasource_should_be_doable.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Add_deployment_should_be_doable.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_can_be_run_multiple_times_in_parallel.json +32 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +23 -0
- data/spec/vcr_cassettes/Operation/Secure/Operation/should_not_be_possible_to_perform_on_closed_client.json +12 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +9 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +9 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_bail_with_no_host.json +3 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established.json +9 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_be_established_via_entrypoint.json +9 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback.json +18 -0
- data/spec/vcr_cassettes/Operation/Secure/Websocket_connection/should_run_into_error_callback_because_bad_hash_parameters.json +13 -0
- metadata +526 -282
- data/spec/vcr_cassettes/Metrics/metrics_0_16_0/Templates/Tenants/Should_create_and_return_tenant.yml +0 -95
- data/spec/vcr_cassettes/Metrics/metrics_services/Templates/Gauge_metrics/Should_return_platform_memory.yml +0 -48
- data/spec/vcr_cassettes/Metrics/metrics_services/Templates/Tenants/Should_create_and_return_tenant.yml +0 -95
- data/spec/vcr_cassettes/Operation/Operation/Add_JDBC_driver_should_add_the_driver.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Add_datasource_should_be_doable.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Disable_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Remove_JDBC_driver_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Remove_datasource_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Restart_can_be_run_multiple_times_in_parallel.json +0 -40
- data/spec/vcr_cassettes/Operation/Operation/Restart_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Restart_should_not_be_performed_if_resource_path_is_wrong.json +0 -26
- data/spec/vcr_cassettes/Operation/Operation/Undeploy_deployment_should_be_performed_and_eventually_respond_with_success.json +0 -26
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_bail_with_hash_property_error_because_no_callback_at_all.json +0 -9
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_bail_with_hash_property_error_because_no_error-callback_.json +0 -9
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_be_established.json +0 -9
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_be_established_via_entrypoint.json +0 -9
- data/spec/vcr_cassettes/Operation/Websocket_connection/should_run_into_error_callback.json +0 -13
@@ -2,6 +2,9 @@ require "#{File.dirname(__FILE__)}/../vcr/vcr_setup"
|
|
2
2
|
require "#{File.dirname(__FILE__)}/../spec_helper"
|
3
3
|
require 'securerandom'
|
4
4
|
|
5
|
+
SKIP_SECURE_CONTEXT = ENV['SKIP_SECURE_CONTEXT'] || '1'
|
6
|
+
SKIP_SECURE_CONTEXT.freeze
|
7
|
+
|
5
8
|
# examples related to Hawkular Metrics
|
6
9
|
|
7
10
|
# time constants
|
@@ -13,670 +16,718 @@ v8_context = :metrics_0_8_0
|
|
13
16
|
services_context = :metrics_services
|
14
17
|
v16_context = :metrics_0_16_0
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
next
|
20
|
-
end
|
21
|
-
if ENV['SKIP_SERVICES_METRICS'] == '1' && metrics_context == services_context
|
22
|
-
puts 'skipping services metrics'
|
23
|
-
next
|
24
|
-
end
|
19
|
+
# ssl contexts
|
20
|
+
SECURE_CONTEXT = :Secure
|
21
|
+
NON_SECURE_CONTEXT = :NonSecure
|
25
22
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
security_contexts = [NON_SECURE_CONTEXT, SECURE_CONTEXT].freeze
|
24
|
+
vcr_test_tenant_postfix = "-vcr-tenant-#{SecureRandom.uuid}".freeze
|
25
|
+
|
26
|
+
security_contexts.each do |security_context|
|
27
|
+
next if security_context == SECURE_CONTEXT && SKIP_SECURE_CONTEXT == '1'
|
28
|
+
|
29
|
+
[v8_context, services_context, v16_context].each do |metrics_context|
|
30
|
+
if ENV['SKIP_V8_METRICS'] == '1' && metrics_context == v8_context
|
31
|
+
puts 'skipping v8 metrics'
|
32
|
+
next
|
33
|
+
end
|
34
|
+
if ENV['SKIP_SERVICES_METRICS'] == '1' && metrics_context == services_context
|
35
|
+
puts 'skipping services metrics'
|
36
|
+
next
|
33
37
|
end
|
38
|
+
# Secure context not supported for v8
|
39
|
+
next if security_context == SECURE_CONTEXT && metrics_context == v8_context
|
34
40
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
setup_options = {
|
42
|
+
mocked_version: metrics_context == :metrics_services ? nil : v16_version_string,
|
43
|
+
type: security_context
|
44
|
+
}.freeze
|
45
|
+
|
46
|
+
describe "#{metrics_context} #{security_context}" do
|
47
|
+
vcr_test_tenant = "#{security_context}#{metrics_context}#{vcr_test_tenant_postfix}".freeze
|
48
|
+
|
49
|
+
let(:cassette_name) do |example|
|
50
|
+
if example.respond_to?(:example_group) && !example.example_group.description.start_with?(metrics_context.to_s)
|
51
|
+
example.example_group.description + '/'
|
41
52
|
else
|
42
|
-
|
43
|
-
end
|
53
|
+
''
|
54
|
+
end + example.description
|
44
55
|
end
|
45
|
-
end
|
46
|
-
|
47
|
-
after(:all) do
|
48
|
-
require 'fileutils'
|
49
|
-
FileUtils.rm_rf "#{VCR.configuration.cassette_library_dir}/Metrics/#{metrics_context}/tmp"
|
50
|
-
end
|
51
56
|
|
52
|
-
|
53
|
-
|
54
|
-
url = metrics_context == v8_context ? config['url_v8'] : config['url']
|
55
|
-
Net::HTTP.get_response(URI(url))
|
57
|
+
let(:vcr_bindings) do
|
58
|
+
{ id: @random_id, vcr_test_tenant: vcr_test_tenant }
|
56
59
|
end
|
57
|
-
end
|
58
60
|
|
59
|
-
|
60
|
-
|
61
|
-
if
|
62
|
-
|
63
|
-
|
64
|
-
|
61
|
+
around(:each) do |example|
|
62
|
+
run_for = example.metadata[:run_for]
|
63
|
+
if run_for.nil? || run_for.empty? || run_for.include?(metrics_context)
|
64
|
+
@random_id = SecureRandom.uuid
|
65
|
+
if example.metadata[:skip_auto_vcr]
|
66
|
+
example.run
|
67
|
+
else
|
68
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
69
|
+
vcr_bindings,
|
70
|
+
cassette_name,
|
71
|
+
example: example)
|
72
|
+
end
|
65
73
|
end
|
66
74
|
end
|
67
75
|
|
68
|
-
|
69
|
-
|
70
|
-
@client.tenants.create(tenant)
|
71
|
-
created = @client.tenants.query.select { |t| t.id == tenant }
|
72
|
-
expect(created).not_to be nil
|
76
|
+
after(:all) do
|
77
|
+
record_cleanup("Metrics/#{security_context}/#{metrics_context}")
|
73
78
|
end
|
74
|
-
end
|
75
79
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
@client.counters.push_data(@random_id, value: 4)
|
81
|
-
rescue # rubocop:disable Lint/HandleExceptions
|
82
|
-
# This is good
|
83
|
-
else
|
84
|
-
fail 'The call should have failed due to missing tenant'
|
80
|
+
describe 'Simple' do
|
81
|
+
it 'Should be Cool' do
|
82
|
+
url = metrics_context == v8_context ? entrypoint('v8', 'metrics') : entrypoint(security_context, 'metrics')
|
83
|
+
Net::HTTP.get_response(URI(url))
|
85
84
|
end
|
86
85
|
end
|
87
|
-
end
|
88
86
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
else
|
94
|
-
if metrics_context == v16_context
|
95
|
-
setup_client_new_tenant(mocked_version: v16_version_string)
|
87
|
+
describe 'Tenants', run_for: [v8_context, services_context, v16_context] do
|
88
|
+
before(:all) do
|
89
|
+
if metrics_context == v8_context
|
90
|
+
setup_v8_client
|
96
91
|
else
|
97
|
-
|
92
|
+
setup_client(setup_options)
|
98
93
|
end
|
99
94
|
end
|
95
|
+
|
96
|
+
it 'Should create and return tenant' do
|
97
|
+
tenant = @random_id
|
98
|
+
@client.tenants.create(tenant)
|
99
|
+
created = @client.tenants.query.select { |t| t.id == tenant }
|
100
|
+
expect(created).not_to be nil
|
101
|
+
end
|
100
102
|
end
|
101
103
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
example = proc do
|
110
|
-
if (metrics_context == v16_context)
|
111
|
-
@client = setup_client(username: 'jdoe', password: 'password', tenant: 'vcr-test',
|
112
|
-
mocked_version: v16_version_string)
|
104
|
+
describe 'No Tenant', run_for: [services_context, v16_context] do
|
105
|
+
it 'Should fail' do
|
106
|
+
setup_client_without_tenant(setup_options)
|
107
|
+
begin
|
108
|
+
@client.counters.push_data(@random_id, value: 4)
|
109
|
+
rescue # rubocop:disable Lint/HandleExceptions
|
110
|
+
# This is good
|
113
111
|
else
|
114
|
-
|
112
|
+
fail 'The call should have failed due to missing tenant'
|
115
113
|
end
|
114
|
+
end
|
115
|
+
end
|
116
116
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
{ id: id3, data: [{ value: 3 }] }
|
126
|
-
],
|
127
|
-
availabilities: [
|
128
|
-
{ id: id1, data: [{ value: 'up' }] },
|
129
|
-
{ id: id2, data: [{ value: 'down' }] },
|
130
|
-
{ id: id3, data: [{ value: 'up' }] }
|
131
|
-
],
|
132
|
-
gauges: [
|
133
|
-
{ id: id1, data: [{ value: 1.1 }] },
|
134
|
-
{ id: id2, data: [{ value: 2.2 }] },
|
135
|
-
{ id: id3, data: [{ value: 3.3 }] }
|
136
|
-
]
|
137
|
-
)
|
117
|
+
describe 'Mixed metrics', run_for: [v8_context, services_context, v16_context] do
|
118
|
+
before(:all) do
|
119
|
+
if metrics_context == v8_context
|
120
|
+
setup_v8_client tenant: vcr_test_tenant
|
121
|
+
else
|
122
|
+
setup_client(setup_options)
|
123
|
+
end
|
124
|
+
end
|
138
125
|
|
139
|
-
|
140
|
-
|
141
|
-
|
126
|
+
it 'Should requests raw data for multiple metrics', :skip_auto_vcr, run_for: [services_context, v16_context] do
|
127
|
+
id1 = SecureRandom.uuid
|
128
|
+
id2 = SecureRandom.uuid
|
129
|
+
id3 = SecureRandom.uuid
|
130
|
+
|
131
|
+
ids = [id1, id2, id3]
|
132
|
+
bindings = { id1: id1, id2: id2, id3: id3 }
|
133
|
+
example = proc do
|
134
|
+
@client = setup_client(setup_options.merge tenant: vcr_test_tenant)
|
135
|
+
|
136
|
+
expect(@client.counters.raw_data(ids).size).to be 0
|
137
|
+
expect(@client.gauges.raw_data(ids).size).to be 0
|
138
|
+
expect(@client.avail.raw_data(ids).size).to be 0
|
139
|
+
|
140
|
+
@client.push_data(
|
141
|
+
counters: [
|
142
|
+
{ id: id1, data: [{ value: 1 }] },
|
143
|
+
{ id: id2, data: [{ value: 2 }] },
|
144
|
+
{ id: id3, data: [{ value: 3 }] }
|
145
|
+
],
|
146
|
+
availabilities: [
|
147
|
+
{ id: id1, data: [{ value: 'up' }] },
|
148
|
+
{ id: id2, data: [{ value: 'down' }] },
|
149
|
+
{ id: id3, data: [{ value: 'up' }] }
|
150
|
+
],
|
151
|
+
gauges: [
|
152
|
+
{ id: id1, data: [{ value: 1.1 }] },
|
153
|
+
{ id: id2, data: [{ value: 2.2 }] },
|
154
|
+
{ id: id3, data: [{ value: 3.3 }] }
|
155
|
+
]
|
156
|
+
)
|
157
|
+
|
158
|
+
c_metrics = @client.counters.raw_data(ids)
|
159
|
+
g_metrics = @client.gauges.raw_data(ids)
|
160
|
+
a_metrics = @client.avail.raw_data(ids)
|
161
|
+
|
162
|
+
expect(c_metrics.size).to be 3
|
163
|
+
expect(c_metrics).to include(
|
164
|
+
{ 'id' => id1, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 1 }] },
|
165
|
+
{ 'id' => id2, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 2 }] },
|
166
|
+
{ 'id' => id3, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 3 }] }
|
167
|
+
)
|
168
|
+
|
169
|
+
expect(g_metrics.size).to be 3
|
170
|
+
expect(g_metrics).to include(
|
171
|
+
{ 'id' => id1, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 1.1 }] },
|
172
|
+
{ 'id' => id2, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 2.2 }] },
|
173
|
+
{ 'id' => id3, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 3.3 }] }
|
174
|
+
)
|
175
|
+
|
176
|
+
expect(a_metrics.size).to be 3
|
177
|
+
expect(a_metrics).to include(
|
178
|
+
{ 'id' => id1, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 'up' }] },
|
179
|
+
{ 'id' => id2, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 'down' }] },
|
180
|
+
{ 'id' => id3, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 'up' }] }
|
181
|
+
)
|
182
|
+
end
|
183
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
184
|
+
vcr_bindings.merge(bindings),
|
185
|
+
cassette_name,
|
186
|
+
example: example)
|
187
|
+
end
|
142
188
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
{ 'id' => id3, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 3 }] }
|
148
|
-
)
|
189
|
+
it 'Should send mixed metric request of a single type' do
|
190
|
+
@client.push_data(counters: [{ id: @random_id, data: [{ value: 1 }] }])
|
191
|
+
data = @client.counters.get_data(@random_id)
|
192
|
+
expect(data.size).to be 1
|
149
193
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
{ 'id' => id2, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 2.2 }] },
|
154
|
-
{ 'id' => id3, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 3.3 }] }
|
155
|
-
)
|
194
|
+
@client.push_data(availabilities: [{ id: @random_id, data: [{ value: 'down' }] }])
|
195
|
+
data = @client.avail.get_data(@random_id)
|
196
|
+
expect(data.size).to be 1
|
156
197
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
{ 'id' => id2, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 'down' }] },
|
161
|
-
{ 'id' => id3, 'data' => [{ 'timestamp' => a_kind_of(Integer), 'value' => 'up' }] }
|
162
|
-
)
|
198
|
+
@client.push_data(gauges: [{ id: @random_id, data: [{ value: 1.1 }] }])
|
199
|
+
data = @client.gauges.get_data(@random_id)
|
200
|
+
expect(data.size).to be 1
|
163
201
|
end
|
164
202
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
@client.push_data(counters: [{ id: @random_id, data: [{ value: 1 }] }])
|
170
|
-
data = @client.counters.get_data(@random_id)
|
171
|
-
expect(data.size).to be 1
|
172
|
-
|
173
|
-
@client.push_data(availabilities: [{ id: @random_id, data: [{ value: 'down' }] }])
|
174
|
-
data = @client.avail.get_data(@random_id)
|
175
|
-
expect(data.size).to be 1
|
203
|
+
it 'Should send mixed metric request' do
|
204
|
+
expect(@client.counters.get_data(@random_id).size).to be 0
|
205
|
+
expect(@client.gauges.get_data(@random_id).size).to be 0
|
206
|
+
expect(@client.avail.get_data(@random_id).size).to be 0
|
176
207
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
208
|
+
@client.push_data(
|
209
|
+
counters: [{ id: @random_id, data: [{ value: 1 }] }],
|
210
|
+
availabilities: [{ id: @random_id, data: [{ value: 'down' }] }],
|
211
|
+
gauges: [{ id: @random_id, data: [{ value: 1.1 }] }]
|
212
|
+
)
|
181
213
|
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
214
|
+
expect(@client.counters.get_data(@random_id).size).to be 1
|
215
|
+
expect(@client.gauges.get_data(@random_id).size).to be 1
|
216
|
+
expect(@client.avail.get_data(@random_id).size).to be 1
|
217
|
+
end
|
186
218
|
|
187
|
-
|
188
|
-
counters
|
189
|
-
|
190
|
-
|
191
|
-
)
|
219
|
+
it 'Should fetch stats for mixed metric', run_for: [services_context] do
|
220
|
+
expect(@client.counters.get_data(@random_id).size).to be 0
|
221
|
+
expect(@client.gauges.get_data(@random_id).size).to be 0
|
222
|
+
expect(@client.avail.get_data(@random_id).size).to be 0
|
192
223
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
224
|
+
@client.push_data(
|
225
|
+
counters: [{ id: @random_id, data: [{ value: 1 }] }],
|
226
|
+
availabilities: [{ id: @random_id, data: [{ value: 'down' }] }],
|
227
|
+
gauges: [{ id: @random_id, data: [{ value: 1.1 }] }]
|
228
|
+
)
|
197
229
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
timestamps.push(@client.gauges.get_data(@random_id).first['timestamp'])
|
212
|
-
timestamps.push(@client.avail.get_data(@random_id).first['timestamp'])
|
213
|
-
|
214
|
-
stats = @client.query_stats(
|
215
|
-
gauge_ids: [@random_id],
|
216
|
-
counter_ids: [@random_id],
|
217
|
-
avail_ids: [@random_id],
|
218
|
-
starts: timestamps.min,
|
219
|
-
ends: timestamps.max + 1,
|
220
|
-
bucket_duration: "#{timestamps.max - timestamps.min + 1}ms"
|
221
|
-
)
|
222
|
-
|
223
|
-
expect(stats.size).to be 3
|
224
|
-
expect(stats['gauge'][@random_id].first['avg']).to be 1.1
|
225
|
-
expect(stats['counter'][@random_id].first['avg']).to be 1.0
|
226
|
-
expect(stats['availability'][@random_id].first['downtimeCount']).to be 1
|
227
|
-
end
|
228
|
-
end
|
230
|
+
timestamps = []
|
231
|
+
timestamps.push(@client.counters.get_data(@random_id).first['timestamp'])
|
232
|
+
timestamps.push(@client.gauges.get_data(@random_id).first['timestamp'])
|
233
|
+
timestamps.push(@client.avail.get_data(@random_id).first['timestamp'])
|
234
|
+
|
235
|
+
stats = @client.query_stats(
|
236
|
+
gauge_ids: [@random_id],
|
237
|
+
counter_ids: [@random_id],
|
238
|
+
avail_ids: [@random_id],
|
239
|
+
starts: timestamps.min,
|
240
|
+
ends: timestamps.max + 1,
|
241
|
+
bucket_duration: "#{timestamps.max - timestamps.min + 1}ms"
|
242
|
+
)
|
229
243
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
setup_v8_client tenant: @tenant
|
235
|
-
else
|
236
|
-
if metrics_context == v16_context
|
237
|
-
setup_client_new_tenant(mocked_version: v16_version_string)
|
238
|
-
else
|
239
|
-
setup_client_new_tenant
|
240
|
-
end
|
244
|
+
expect(stats.size).to be 3
|
245
|
+
expect(stats['gauge'][@random_id].first['avg']).to be 1.1
|
246
|
+
expect(stats['counter'][@random_id].first['avg']).to be 1.0
|
247
|
+
expect(stats['availability'][@random_id].first['downtimeCount']).to be 1
|
241
248
|
end
|
242
|
-
end
|
243
249
|
|
244
|
-
|
245
|
-
|
246
|
-
end
|
250
|
+
it 'Should fetch rate stats for mixed metric', run_for: [services_context] do
|
251
|
+
expect(@client.counters.get_data(@random_id).size).to be 0
|
247
252
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
it 'Should push metric data to existing counter', :skip_auto_vcr do
|
253
|
-
now = @client.now
|
254
|
-
minus10 = now - 10
|
255
|
-
minus20 = now - 20
|
256
|
-
minus30 = now - 30
|
257
|
-
minus8h = now - (2 * t4h)
|
258
|
-
minus4h = now - t4h
|
259
|
-
|
260
|
-
bindings = { id: @random_id, minus10: minus10, minus20: minus20, minus30: minus30,
|
261
|
-
minus8h: minus8h, minus4h: minus4h }
|
262
|
-
example = proc do
|
263
|
-
# create counter
|
264
|
-
@client.counters.create(id: @random_id)
|
265
|
-
|
266
|
-
# push 3 values with timestamps
|
267
|
-
@client.counters.push_data(@random_id, [{ value: 1, timestamp: minus30 },
|
268
|
-
{ value: 2, timestamp: minus20 },
|
269
|
-
{ value: 3, timestamp: minus10 }])
|
253
|
+
@client.push_data(counters: [{ id: @random_id, data: [{ value: 100.0 }] }])
|
254
|
+
@client.push_data(counters: [{ id: @random_id, data: [{ value: 110.0 }] }])
|
255
|
+
@client.push_data(counters: [{ id: @random_id, data: [{ value: 130.0 }] }])
|
256
|
+
@client.push_data(counters: [{ id: @random_id, data: [{ value: 200.0 }] }])
|
270
257
|
|
271
|
-
data = @client.counters.get_data(@random_id)
|
272
|
-
expect(data.size).to be 3
|
273
|
-
|
274
|
-
# push one value without timestamp (which means now)
|
275
|
-
@client.counters.push_data(@random_id, value: 4)
|
276
258
|
data = @client.counters.get_data(@random_id)
|
277
259
|
expect(data.size).to be 4
|
260
|
+
timestamps = data.map { |d| d['timestamp'] }
|
261
|
+
|
262
|
+
stats = @client.query_stats(
|
263
|
+
counter_ids: [@random_id],
|
264
|
+
starts: timestamps.min,
|
265
|
+
ends: timestamps.max + 1,
|
266
|
+
rates: true,
|
267
|
+
bucket_duration: "#{timestamps.max - timestamps.min + 1}ms"
|
268
|
+
)
|
278
269
|
|
279
|
-
|
280
|
-
|
281
|
-
expect(
|
270
|
+
expect(stats.size).to be 2
|
271
|
+
expect(stats['counter'][@random_id].size).to be 1
|
272
|
+
expect(stats['counter_rate'][@random_id].size).to be 1
|
282
273
|
end
|
283
|
-
record("Metrics/#{metrics_context}", bindings, cassette_name, example: example)
|
284
274
|
end
|
285
275
|
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
minus8h: minus8h, minus4h: minus4h }
|
296
|
-
|
297
|
-
example = proc do
|
298
|
-
# create counter
|
299
|
-
@client.counters.create(id: @random_id)
|
300
|
-
|
301
|
-
# push 3 values with timestamps
|
302
|
-
@client.counters.push_data(@random_id, [{ value: 1, timestamp: minus30 },
|
303
|
-
{ value: 2, timestamp: minus20 },
|
304
|
-
{ value: 3, timestamp: minus10 }])
|
276
|
+
describe 'Counter metrics' do
|
277
|
+
before(:all) do
|
278
|
+
@tenant = vcr_test_tenant
|
279
|
+
if metrics_context == v8_context
|
280
|
+
setup_v8_client tenant: @tenant
|
281
|
+
else
|
282
|
+
setup_client(setup_options.merge(tenant: @tenant))
|
283
|
+
end
|
284
|
+
end
|
305
285
|
|
306
|
-
|
307
|
-
|
286
|
+
it 'Should create and return counter using Hash parameter' do
|
287
|
+
create_metric_using_hash @client.counters, @random_id, @tenant
|
288
|
+
end
|
308
289
|
|
309
|
-
|
310
|
-
@client.counters
|
311
|
-
|
312
|
-
expect(data.size).to be 4
|
290
|
+
it 'Should create counter definition using MetricDefinition parameter' do
|
291
|
+
create_metric_using_md @client.counters, @random_id
|
292
|
+
end
|
313
293
|
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
294
|
+
it 'Should push metric data to existing counter', :skip_auto_vcr do
|
295
|
+
now = @client.now
|
296
|
+
minus10 = now - 10
|
297
|
+
minus20 = now - 20
|
298
|
+
minus30 = now - 30
|
299
|
+
minus8h = now - (2 * t4h)
|
300
|
+
minus4h = now - t4h
|
301
|
+
|
302
|
+
bindings = { id: @random_id, minus10: minus10, minus20: minus20, minus30: minus30,
|
303
|
+
minus8h: minus8h, minus4h: minus4h }
|
304
|
+
example = proc do
|
305
|
+
# create counter
|
306
|
+
@client.counters.create(id: @random_id)
|
307
|
+
|
308
|
+
# push 3 values with timestamps
|
309
|
+
@client.counters.push_data(@random_id, [{ value: 1, timestamp: minus30 },
|
310
|
+
{ value: 2, timestamp: minus20 },
|
311
|
+
{ value: 3, timestamp: minus10 }])
|
312
|
+
|
313
|
+
data = @client.counters.get_data(@random_id)
|
314
|
+
expect(data.size).to be 3
|
315
|
+
|
316
|
+
# push one value without timestamp (which means now)
|
317
|
+
@client.counters.push_data(@random_id, value: 4)
|
318
|
+
data = @client.counters.get_data(@random_id)
|
319
|
+
expect(data.size).to be 4
|
320
|
+
|
321
|
+
# retrieve values from past
|
322
|
+
data = @client.counters.get_data(@random_id, starts: minus8h, ends: minus4h)
|
323
|
+
expect(data.empty?).to be true
|
324
|
+
end
|
325
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
326
|
+
vcr_bindings.merge(bindings),
|
327
|
+
cassette_name,
|
328
|
+
example: example)
|
329
|
+
end
|
318
330
|
|
319
|
-
|
320
|
-
|
321
|
-
|
331
|
+
# limit and order were introduced in 0.11.0 => skipping for 0.8.0
|
332
|
+
it 'Should get metrics with limit and order', run_for: [services_context, v16_context], skip_auto_vcr: true do
|
333
|
+
now = @client.now
|
334
|
+
minus10 = now - 10
|
335
|
+
minus20 = now - 20
|
336
|
+
minus30 = now - 30
|
337
|
+
minus8h = now - (2 * t4h)
|
338
|
+
minus4h = now - t4h
|
339
|
+
bindings = { id: @random_id, minus10: minus10, minus20: minus20, minus30: minus30,
|
340
|
+
minus8h: minus8h, minus4h: minus4h }
|
341
|
+
|
342
|
+
example = proc do
|
343
|
+
# create counter
|
344
|
+
@client.counters.create(id: @random_id)
|
345
|
+
|
346
|
+
# push 3 values with timestamps
|
347
|
+
@client.counters.push_data(@random_id, [{ value: 1, timestamp: minus30 },
|
348
|
+
{ value: 2, timestamp: minus20 },
|
349
|
+
{ value: 3, timestamp: minus10 }])
|
350
|
+
|
351
|
+
data = @client.counters.get_data(@random_id)
|
352
|
+
expect(data.size).to be 3
|
353
|
+
|
354
|
+
# push one value without timestamp (which means now)
|
355
|
+
@client.counters.push_data(@random_id, value: 4)
|
356
|
+
data = @client.counters.get_data(@random_id)
|
357
|
+
expect(data.size).to be 4
|
358
|
+
|
359
|
+
# retrieve values with limit
|
360
|
+
data = @client.counters.get_data(@random_id, limit: 1, order: 'DESC')
|
361
|
+
expect(data.size).to be 1
|
362
|
+
expect(data.first['value']).to be 4
|
363
|
+
|
364
|
+
# retrieve values from past
|
365
|
+
data = @client.counters.get_data(@random_id, starts: minus8h, ends: minus4h)
|
366
|
+
expect(data.empty?).to be true
|
367
|
+
end
|
368
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
369
|
+
vcr_bindings.merge(bindings),
|
370
|
+
cassette_name,
|
371
|
+
example: example)
|
322
372
|
end
|
323
|
-
record("Metrics/#{metrics_context}", bindings, cassette_name, example: example)
|
324
|
-
end
|
325
373
|
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
374
|
+
it 'Should get metrics as bucketed results', :skip_auto_vcr do
|
375
|
+
now = @client.now
|
376
|
+
minus5 = now - 5
|
377
|
+
minus10 = now - 10
|
378
|
+
minus20 = now - 20
|
379
|
+
minus30 = now - 30
|
380
|
+
minus40 = now - 40
|
381
|
+
minus50 = now - 50
|
382
|
+
minus60 = now - 60
|
383
|
+
minus70 = now - 70
|
384
|
+
minus80 = now - 80
|
385
|
+
minus90 = now - 90
|
386
|
+
minus100 = now - 100
|
387
|
+
minus105 = now - 105
|
388
|
+
minus110 = now - 110
|
389
|
+
bindings = { id: @random_id, minus5: minus5, minus10: minus10, minus20: minus20, minus30: minus30,
|
390
|
+
minus40: minus40, minus50: minus50, minus60: minus60, minus70: minus70, minus80: minus80,
|
391
|
+
minus90: minus90, minus100: minus100, minus105: minus105, minus110: minus110 }
|
392
|
+
example = proc do
|
393
|
+
# create counter
|
394
|
+
@client.counters.create(id: @random_id)
|
395
|
+
|
396
|
+
# push 10 values with timestamps
|
397
|
+
@client.counters.push_data(@random_id, [{ value: 110, timestamp: minus110 },
|
398
|
+
{ value: 100, timestamp: minus100 },
|
399
|
+
{ value: 90, timestamp: minus90 },
|
400
|
+
{ value: 80, timestamp: minus80 },
|
401
|
+
{ value: 70, timestamp: minus70 },
|
402
|
+
{ value: 60, timestamp: minus60 },
|
403
|
+
{ value: 50, timestamp: minus50 },
|
404
|
+
{ value: 40, timestamp: minus40 },
|
405
|
+
{ value: 30, timestamp: minus30 },
|
406
|
+
{ value: 20, timestamp: minus20 },
|
407
|
+
{ value: 10, timestamp: minus10 }])
|
408
|
+
err = 0.001
|
409
|
+
data = @client.counters.get_data(@random_id, starts: minus105, ends: minus5, buckets: 5)
|
410
|
+
expect(data.size).to be 5
|
411
|
+
expect(data.first['avg']).to be_within(err).of(95.0)
|
412
|
+
expect(data.first['max']).to be_within(err).of(100.0)
|
413
|
+
expect(data.first['samples']).to be 2
|
414
|
+
|
415
|
+
data = @client.counters.get_data(@random_id, starts: minus105, ends: minus5, buckets: 2)
|
416
|
+
expect(data.size).to be 2
|
417
|
+
expect(data.first['avg']).to be_within(err).of(80.0)
|
418
|
+
expect(data.first['samples']).to be 5
|
419
|
+
|
420
|
+
data = @client.counters.get_data(@random_id, starts: minus105, ends: minus5, bucketDuration: '50ms')
|
421
|
+
expect(data.size).to be 2
|
422
|
+
expect(data.first['avg']).to be_within(err).of(80.0)
|
423
|
+
end
|
424
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
425
|
+
vcr_bindings.merge(bindings),
|
426
|
+
cassette_name,
|
427
|
+
example: example)
|
428
|
+
end
|
378
429
|
|
379
|
-
|
380
|
-
|
430
|
+
it 'Should push metric data to non-existing counter' do
|
431
|
+
push_data_to_non_existing_metric @client.counters, { value: 4 }, @random_id
|
432
|
+
end
|
381
433
|
end
|
382
|
-
end
|
383
434
|
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
else
|
390
|
-
if metrics_context == v16_context
|
391
|
-
setup_client_new_tenant(mocked_version: v16_version_string)
|
435
|
+
describe 'Availability metrics' do
|
436
|
+
before(:all) do
|
437
|
+
@tenant = vcr_test_tenant
|
438
|
+
if metrics_context == v8_context
|
439
|
+
setup_v8_client tenant: @tenant
|
392
440
|
else
|
393
|
-
|
441
|
+
setup_client(setup_options.merge(tenant: @tenant))
|
394
442
|
end
|
395
443
|
end
|
396
|
-
end
|
397
444
|
|
398
|
-
|
399
|
-
|
400
|
-
|
445
|
+
it 'Should create and return Availability using Hash parameter' do
|
446
|
+
create_metric_using_hash @client.avail, @random_id, @tenant
|
447
|
+
end
|
401
448
|
|
402
|
-
|
403
|
-
|
404
|
-
|
449
|
+
it 'Should create Availability definition using MetricDefinition parameter' do
|
450
|
+
create_metric_using_md @client.avail, @random_id
|
451
|
+
end
|
405
452
|
|
406
|
-
|
407
|
-
|
408
|
-
|
453
|
+
it 'Should push metric data to non-existing Availability' do
|
454
|
+
push_data_to_non_existing_metric @client.avail, { value: 'UP' }, @random_id
|
455
|
+
end
|
409
456
|
|
410
|
-
|
411
|
-
|
412
|
-
|
457
|
+
it 'Should update tags for Availability definition' do
|
458
|
+
update_metric_by_tags @client.avail, @random_id
|
459
|
+
end
|
413
460
|
|
414
|
-
|
415
|
-
|
416
|
-
|
461
|
+
it 'Should raise ArgumentError availability does not accept percentiles param' do
|
462
|
+
expect { @client.avail.get_data(@random_id, percentiles: 50) }.to raise_error(ArgumentError)
|
463
|
+
end
|
417
464
|
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
@client
|
430
|
-
|
431
|
-
|
432
|
-
|
465
|
+
it 'Should group contiguous values', :skip_auto_vcr, run_for: [services_context, v16_context] do
|
466
|
+
now = @client.now
|
467
|
+
minus10 = now - 10
|
468
|
+
minus20 = now - 20
|
469
|
+
minus30 = now - 30
|
470
|
+
minus40 = now - 40
|
471
|
+
minus50 = now - 50
|
472
|
+
bindings = { id: @random_id, minus10: minus10, minus20: minus20, minus30: minus30, minus40: minus40,
|
473
|
+
minus50: minus50, now: now }
|
474
|
+
example = proc do
|
475
|
+
@client = setup_client(setup_options.merge tenant: vcr_test_tenant)
|
476
|
+
@client.avail.push_data(@random_id, [
|
477
|
+
{ timestamp: minus50, value: 'up' },
|
478
|
+
{ timestamp: minus40, value: 'up' },
|
479
|
+
{ timestamp: minus30, value: 'down' },
|
480
|
+
{ timestamp: minus20, value: 'down' },
|
481
|
+
{ timestamp: minus10, value: 'down' },
|
482
|
+
{ timestamp: now, value: 'up' }
|
483
|
+
])
|
484
|
+
result = @client.avail.get_data(@random_id, distinct: true, order: 'ASC')
|
485
|
+
expect(result).to eq([
|
486
|
+
{ 'timestamp' => minus50, 'value' => 'up' },
|
487
|
+
{ 'timestamp' => minus30, 'value' => 'down' },
|
488
|
+
{ 'timestamp' => now, 'value' => 'up' }
|
489
|
+
])
|
433
490
|
end
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
{ timestamp: minus10, value: 'down' },
|
440
|
-
{ timestamp: now, value: 'up' }
|
441
|
-
])
|
442
|
-
result = @client.avail.get_data(@random_id, distinct: true, order: 'ASC')
|
443
|
-
expect(result).to eq([
|
444
|
-
{ 'timestamp' => minus50, 'value' => 'up' },
|
445
|
-
{ 'timestamp' => minus30, 'value' => 'down' },
|
446
|
-
{ 'timestamp' => now, 'value' => 'up' }
|
447
|
-
])
|
448
|
-
end
|
449
|
-
|
450
|
-
record("Metrics/#{metrics_context}", bindings, cassette_name, example: example)
|
491
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
492
|
+
vcr_bindings.merge(bindings),
|
493
|
+
cassette_name,
|
494
|
+
example: example)
|
495
|
+
end
|
451
496
|
end
|
452
|
-
end
|
453
497
|
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
498
|
+
describe 'Gauge metrics' do
|
499
|
+
hawkular_tenant_id = 'hawkular'.freeze
|
500
|
+
hawkular_feed_id = 'af0ea377-80f4-4567-af45-105eaa808b92'.freeze
|
501
|
+
hawkular_mem_id = "MI~R~[#{hawkular_feed_id}/platform~/OPERATING_SYSTEM=#{hawkular_feed_id}"\
|
502
|
+
'_OperatingSystem/MEMORY=Memory]~MT~Total Memory'.freeze
|
503
|
+
|
504
|
+
before(:all) do
|
505
|
+
@tenant = vcr_test_tenant
|
506
|
+
if metrics_context == v8_context
|
507
|
+
setup_v8_client tenant: @tenant
|
462
508
|
else
|
463
|
-
|
509
|
+
setup_client(setup_options.merge(tenant: @tenant))
|
464
510
|
end
|
465
511
|
end
|
466
|
-
end
|
467
512
|
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
it 'Should create gauge definition using Hash' do
|
473
|
-
create_metric_using_hash @client.gauges, @random_id, @tenant
|
474
|
-
end
|
475
|
-
|
476
|
-
it 'Should push metric data to non-existing gauge' do
|
477
|
-
push_data_to_non_existing_metric @client.gauges, { value: 3.1415926 }, @random_id
|
478
|
-
end
|
513
|
+
it 'Should create gauge definition using MetricDefinition' do
|
514
|
+
create_metric_using_md @client.gauges, @random_id
|
515
|
+
end
|
479
516
|
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
ends = now - t4h
|
484
|
-
starts = now - (2 * t4h)
|
485
|
-
now10 = now - 10
|
486
|
-
now20 = now - 20
|
487
|
-
now30 = now - 30
|
488
|
-
bindings = { id: @random_id, ends: ends, starts: starts, now10: now10, now20: now20, now30: now30 }
|
489
|
-
example = proc do
|
490
|
-
# create gauge
|
491
|
-
@client.gauges.create(id: @random_id)
|
492
|
-
|
493
|
-
# push 3 values with timestamps
|
494
|
-
@client.gauges.push_data(@random_id,
|
495
|
-
[{ value: 1, timestamp: now30 },
|
496
|
-
{ value: 2, timestamp: now20 },
|
497
|
-
{ value: 3, timestamp: now10 }])
|
517
|
+
it 'Should create gauge definition using Hash' do
|
518
|
+
create_metric_using_hash @client.gauges, @random_id, @tenant
|
519
|
+
end
|
498
520
|
|
499
|
-
|
500
|
-
|
521
|
+
it 'Should push metric data to non-existing gauge' do
|
522
|
+
push_data_to_non_existing_metric @client.gauges, { value: 3.1415926 }, @random_id
|
523
|
+
end
|
501
524
|
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
525
|
+
# let's do the recording manually
|
526
|
+
it 'Should push metric data to existing gauge', :skip_auto_vcr do
|
527
|
+
now = @client.now
|
528
|
+
ends = now - t4h
|
529
|
+
starts = now - (2 * t4h)
|
530
|
+
now10 = now - 10
|
531
|
+
now20 = now - 20
|
532
|
+
now30 = now - 30
|
533
|
+
bindings = { id: @random_id, ends: ends, starts: starts, now10: now10, now20: now20, now30: now30 }
|
534
|
+
example = proc do
|
535
|
+
# create gauge
|
536
|
+
@client.gauges.create(id: @random_id)
|
537
|
+
|
538
|
+
# push 3 values with timestamps
|
539
|
+
@client.gauges.push_data(@random_id,
|
540
|
+
[{ value: 1, timestamp: now30 },
|
541
|
+
{ value: 2, timestamp: now20 },
|
542
|
+
{ value: 3, timestamp: now10 }])
|
543
|
+
|
544
|
+
data = @client.gauges.get_data(@random_id)
|
545
|
+
expect(data.size).to be 3
|
546
|
+
|
547
|
+
# push one value without timestamp (which means now)
|
548
|
+
@client.gauges.push_data(@random_id, value: 4)
|
549
|
+
data = @client.gauges.get_data(@random_id)
|
550
|
+
expect(data.size).to be 4
|
551
|
+
|
552
|
+
# retrieve values from past
|
553
|
+
data = @client.counters.get_data(@random_id, starts: starts, ends: ends)
|
554
|
+
expect(data.empty?).to be true
|
555
|
+
end
|
556
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
557
|
+
vcr_bindings.merge(bindings),
|
558
|
+
cassette_name,
|
559
|
+
example: example)
|
560
|
+
end
|
506
561
|
|
507
|
-
|
508
|
-
|
509
|
-
expect(data.empty?).to be true
|
562
|
+
it 'Should update tags for gauge definition' do
|
563
|
+
update_metric_by_tags @client.gauges, @random_id
|
510
564
|
end
|
511
|
-
record("Metrics/#{metrics_context}", bindings, cassette_name, example: example)
|
512
|
-
end
|
513
565
|
|
514
|
-
|
515
|
-
|
516
|
-
|
566
|
+
it 'Should return periods', :skip_auto_vcr do
|
567
|
+
now = @client.now
|
568
|
+
before4h = now - t4h
|
569
|
+
minus20 = now - 20
|
570
|
+
minus30 = now - 30
|
571
|
+
bindings = { start: now, before4h: before4h, minus20: minus20, minus30: minus30 }
|
572
|
+
example = proc do
|
573
|
+
# push 3 values with timestamps
|
574
|
+
@client.gauges.push_data(@random_id, [{ value: 1, timestamp: minus30 },
|
575
|
+
{ value: 2, timestamp: minus20 },
|
576
|
+
{ value: 3, timestamp: now }])
|
517
577
|
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
{ value: 2, timestamp: minus20 },
|
528
|
-
{ value: 3, timestamp: now }])
|
529
|
-
|
530
|
-
data = @client.gauges.get_periods(@random_id, operation: 'lte', threshold: 4, starts: before4h)
|
531
|
-
expect(data.size).to be 1
|
532
|
-
expect(data[0][0]).to eql(now - 30)
|
533
|
-
expect(data[0][1]).to eql(now)
|
578
|
+
data = @client.gauges.get_periods(@random_id, operation: 'lte', threshold: 4, starts: before4h)
|
579
|
+
expect(data.size).to be 1
|
580
|
+
expect(data[0][0]).to eql(now - 30)
|
581
|
+
expect(data[0][1]).to eql(now)
|
582
|
+
end
|
583
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
584
|
+
vcr_bindings.merge(bindings),
|
585
|
+
cassette_name,
|
586
|
+
example: example)
|
534
587
|
end
|
535
|
-
record("Metrics/#{metrics_context}", bindings, cassette_name, example: example)
|
536
|
-
end
|
537
588
|
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
589
|
+
it 'Should return platform memory def', :skip_auto_vcr, run_for: [services_context] do
|
590
|
+
bindings = { mem_id: hawkular_mem_id, tenant: hawkular_tenant_id }
|
591
|
+
example = proc do
|
592
|
+
if metrics_context == v8_context
|
593
|
+
setup_v8_client tenant: hawkular_tenant_id
|
594
|
+
else
|
595
|
+
setup_client(setup_options.merge tenant: hawkular_tenant_id)
|
596
|
+
end
|
542
597
|
|
543
|
-
|
544
|
-
example = proc do
|
545
|
-
tenant_id = 'hawkular'
|
546
|
-
if metrics_context == v8_context
|
547
|
-
setup_v8_client tenant: tenant_id
|
548
|
-
else
|
549
|
-
setup_client tenant: tenant_id
|
550
|
-
end
|
598
|
+
data = @client.gauges.get(hawkular_mem_id)
|
551
599
|
|
552
|
-
|
600
|
+
expect(data).not_to be_nil
|
601
|
+
expect(data.id).not_to be_nil
|
602
|
+
expect(data.tenant_id).to eq(hawkular_tenant_id)
|
603
|
+
end
|
604
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
605
|
+
vcr_bindings.merge(bindings),
|
606
|
+
cassette_name,
|
607
|
+
example: example)
|
608
|
+
end
|
553
609
|
|
554
|
-
|
555
|
-
|
556
|
-
|
610
|
+
it 'Should return platform memory', :skip_auto_vcr, run_for: [services_context] do
|
611
|
+
bindings = { mem_id: hawkular_mem_id, tenant: hawkular_tenant_id }
|
612
|
+
example = proc do
|
613
|
+
# this id depends on OS and the feed id
|
614
|
+
if metrics_context == v8_context
|
615
|
+
setup_v8_client tenant: tenant_id
|
616
|
+
else
|
617
|
+
setup_client(setup_options.merge tenant: hawkular_tenant_id)
|
618
|
+
end
|
619
|
+
|
620
|
+
data = @client.gauges.get_data(hawkular_mem_id)
|
621
|
+
expect(data.size).to be > 2 # needs the services to be running for more than 2 minutes
|
622
|
+
end
|
623
|
+
record("Metrics/#{security_context}/#{metrics_context}",
|
624
|
+
vcr_bindings.merge(bindings),
|
625
|
+
cassette_name,
|
626
|
+
example: example)
|
557
627
|
end
|
558
|
-
record("Metrics/#{metrics_context}", bindings, cassette_name, example: example)
|
559
628
|
end
|
560
629
|
|
561
|
-
|
562
|
-
|
563
|
-
feed = 'b37ba088-6bfa-4877-83af-b3747696bfb1'
|
564
|
-
mem_id = "MI~R~[#{feed}/platform~/OPERATING_SYSTEM=#{feed}_OperatingSystem/MEMORY=Memory]~MT~Total Memory"
|
565
|
-
|
566
|
-
bindings = { id: @random_id, mem_id: mem_id }
|
567
|
-
example = proc do
|
568
|
-
tenant_id = 'hawkular'
|
630
|
+
describe 'Status' do
|
631
|
+
it 'Should return the version' do
|
569
632
|
if metrics_context == v8_context
|
570
|
-
setup_v8_client
|
633
|
+
setup_v8_client
|
571
634
|
else
|
572
|
-
setup_client
|
635
|
+
setup_client setup_options
|
573
636
|
end
|
574
|
-
|
575
|
-
data
|
576
|
-
expect(data.size).to be > 2 # needs the services to be running for more than 2 minutes
|
637
|
+
data = @client.fetch_version_and_status
|
638
|
+
expect(data).not_to be_nil
|
577
639
|
end
|
578
|
-
record("Metrics/#{metrics_context}", bindings, cassette_name, example: example)
|
579
640
|
end
|
580
641
|
end
|
581
|
-
|
582
|
-
it 'Status/Should return the version' do
|
583
|
-
if metrics_context == v8_context
|
584
|
-
setup_v8_client
|
585
|
-
else
|
586
|
-
setup_client
|
587
|
-
end
|
588
|
-
data = @client.fetch_version_and_status
|
589
|
-
expect(data).not_to be_nil
|
590
|
-
end
|
591
642
|
end
|
592
|
-
end
|
593
643
|
|
594
|
-
|
595
|
-
before(:all) do
|
596
|
-
setup_client(username: 'jdoe', password: 'password', tenant: 'vcr-test')
|
597
|
-
end
|
644
|
+
vcr_test_tenant = "#{security_context}#{vcr_test_tenant_postfix}".freeze
|
598
645
|
|
599
|
-
|
600
|
-
|
601
|
-
|
646
|
+
context security_context do
|
647
|
+
describe 'Metric ID with special characters' do
|
648
|
+
before(:all) do
|
649
|
+
setup_client(type: security_context, tenant: vcr_test_tenant)
|
650
|
+
end
|
602
651
|
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
652
|
+
around(:each) do |example|
|
653
|
+
record("Metrics/#{security_context}/ID_with_special_characters",
|
654
|
+
{ vcr_test_tenant: vcr_test_tenant },
|
655
|
+
example.description,
|
656
|
+
example: example)
|
657
|
+
end
|
608
658
|
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
end
|
613
|
-
end
|
659
|
+
after(:all) do
|
660
|
+
record_cleanup("Metrics/#{security_context}/ID_with_special_characters")
|
661
|
+
end
|
614
662
|
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
end
|
663
|
+
id_gauge = 'MI~R~[8b*}{\'\\14#?/5-7%92e[-c9_.r1//;/74eddf/L=c~~]~MT~ * /'\
|
664
|
+
' Met@ics~Aggre&? ated s Active" Ses;ns'
|
665
|
+
id_avail = 'AA~R~[8b*}{\'\\14#?/5-7%92[d-c9_.r1///7;:4eddf/L=c~~]~MT~ A * %-Met@ics~Aggre&?ated " Sess{ons'
|
666
|
+
id_counter = 'AA~R~[8b*}{\'\\14#?/5-7%92[d-c9_.r1///7;:4eddf/L=c~~]~MT~ %-Met@ics~Aggre&?ated " Sess{ons'
|
620
667
|
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
{ value: 0.1, tags: { tagName: 'myMin' } },
|
625
|
-
{ value: 99.9, tags: { tagName: 'myMax' } }
|
626
|
-
])
|
627
|
-
end
|
628
|
-
end
|
668
|
+
it 'Should create gauge definition' do
|
669
|
+
create_metric_using_md @client.gauges, id_gauge
|
670
|
+
end
|
629
671
|
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
deff.tags = {
|
634
|
-
name1: 'value1',
|
635
|
-
name2: 'value2',
|
636
|
-
name3: 'value3'
|
637
|
-
}
|
638
|
-
@client.gauges.update_tags(deff)
|
639
|
-
deff_updated = @client.gauges.get(id_gauge)
|
640
|
-
expected_result = {
|
641
|
-
'name1' => 'value1',
|
642
|
-
'name2' => 'value2',
|
643
|
-
'name3' => 'value3',
|
644
|
-
'tag' => 'value'
|
645
|
-
}
|
646
|
-
expect(deff_updated.tags).to eq(expected_result)
|
647
|
-
end
|
648
|
-
end
|
672
|
+
it 'Should create Availability definition' do
|
673
|
+
create_metric_using_md @client.avail, id_avail
|
674
|
+
end
|
649
675
|
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
deff_avail.tags = {
|
654
|
-
name1: 'value1',
|
655
|
-
name2: 'value2',
|
656
|
-
name3: 'value3'
|
657
|
-
}
|
658
|
-
@client.avail.update_tags(deff_avail)
|
659
|
-
deff_avail_updated = @client.avail.get(id_avail)
|
660
|
-
expected_result = {
|
661
|
-
'name1' => 'value1',
|
662
|
-
'name2' => 'value2',
|
663
|
-
'name3' => 'value3',
|
664
|
-
'tag' => 'value'
|
665
|
-
}
|
666
|
-
expect(deff_avail_updated.tags).to eq(expected_result)
|
667
|
-
end
|
668
|
-
end
|
676
|
+
it 'Should create Counter definition' do
|
677
|
+
create_metric_using_md @client.counters, id_counter
|
678
|
+
end
|
669
679
|
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
680
|
+
it 'Should push metric data to existing gauge' do
|
681
|
+
@client.gauges.push_data(id_gauge, [
|
682
|
+
{ value: 0.1, tags: { tagName: 'myMin' } },
|
683
|
+
{ value: 99.9, tags: { tagName: 'myMax' } }
|
684
|
+
])
|
685
|
+
end
|
675
686
|
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
687
|
+
it 'Should update tags for gauge definition' do
|
688
|
+
deff = @client.gauges.get(id_gauge)
|
689
|
+
deff.tags = {
|
690
|
+
name1: 'value1',
|
691
|
+
name2: 'value2',
|
692
|
+
name3: 'value3'
|
693
|
+
}
|
694
|
+
@client.gauges.update_tags(deff)
|
695
|
+
deff_updated = @client.gauges.get(id_gauge)
|
696
|
+
expected_result = {
|
697
|
+
'name1' => 'value1',
|
698
|
+
'name2' => 'value2',
|
699
|
+
'name3' => 'value3',
|
700
|
+
'tag' => 'value'
|
701
|
+
}
|
702
|
+
expect(deff_updated.tags).to eq(expected_result)
|
703
|
+
end
|
704
|
+
|
705
|
+
it 'Should update tags for Availability definition' do
|
706
|
+
deff_avail = @client.avail.get(id_avail)
|
707
|
+
deff_avail.tags = {
|
708
|
+
name1: 'value1',
|
709
|
+
name2: 'value2',
|
710
|
+
name3: 'value3'
|
711
|
+
}
|
712
|
+
@client.avail.update_tags(deff_avail)
|
713
|
+
deff_avail_updated = @client.avail.get(id_avail)
|
714
|
+
expected_result = {
|
715
|
+
'name1' => 'value1',
|
716
|
+
'name2' => 'value2',
|
717
|
+
'name3' => 'value3',
|
718
|
+
'tag' => 'value'
|
719
|
+
}
|
720
|
+
expect(deff_avail_updated.tags).to eq(expected_result)
|
721
|
+
end
|
722
|
+
|
723
|
+
it 'Get metric definition by id' do
|
724
|
+
@client.gauges.get(id_gauge)
|
725
|
+
end
|
726
|
+
|
727
|
+
it 'Retrieve metric rate points' do
|
728
|
+
@client.gauges.get(id_gauge)
|
729
|
+
@client.counters.get_rate id_counter
|
730
|
+
end
|
680
731
|
end
|
681
732
|
end
|
682
733
|
end
|