github.com/lulzWill/go-agent@v2.1.2+incompatible/internal/crossagent/cross_agent_tests/utilization/utilization_json.json (about) 1 [ 2 { 3 "testname": "only agent derived data", 4 "input_total_ram_mib": 1024, 5 "input_logical_processors": 8, 6 "input_hostname": "myhost", 7 "expected_output_json": { 8 "metadata_version": 3, 9 "logical_processors": 8, 10 "total_ram_mib": 1024, 11 "hostname": "myhost" 12 } 13 }, 14 { 15 "testname": "only agent derived but bad data", 16 "input_total_ram_mib": null, 17 "input_logical_processors": null, 18 "input_hostname": "myotherhost", 19 "expected_output_json": { 20 "metadata_version": 3, 21 "logical_processors": null, 22 "total_ram_mib": null, 23 "hostname": "myotherhost" 24 } 25 }, 26 { 27 "testname": "agent derived null and some environment variables", 28 "input_total_ram_mib": null, 29 "input_logical_processors": null, 30 "input_hostname": "myotherhost", 31 "input_environment_variables": { 32 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": 8, 33 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": 2048 34 }, 35 "expected_output_json": { 36 "metadata_version": 3, 37 "logical_processors": null, 38 "total_ram_mib": null, 39 "hostname": "myotherhost", 40 "config": { 41 "logical_processors": 8, 42 "total_ram_mib": 2048 43 } 44 } 45 }, 46 { 47 "testname": "all environment variables", 48 "input_total_ram_mib": 1, 49 "input_logical_processors": 2, 50 "input_hostname": "myotherhost", 51 "input_environment_variables": { 52 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": 16, 53 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": 4096, 54 "NEW_RELIC_UTILIZATION_BILLING_HOSTNAME": "localhost" 55 }, 56 "expected_output_json": { 57 "metadata_version": 3, 58 "logical_processors": 2, 59 "total_ram_mib": 1, 60 "hostname": "myotherhost", 61 "config": { 62 "logical_processors": 16, 63 "total_ram_mib": 4096, 64 "hostname": "localhost" 65 } 66 } 67 }, 68 { 69 "testname": "all environment variables with error in processors", 70 "input_total_ram_mib": 1024, 71 "input_logical_processors": 4, 72 "input_hostname": "myotherhost", 73 "input_environment_variables": { 74 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": "abc", 75 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": 4096, 76 "NEW_RELIC_UTILIZATION_BILLING_HOSTNAME": "localhost" 77 }, 78 "expected_output_json": { 79 "metadata_version": 3, 80 "logical_processors": 4, 81 "total_ram_mib": 1024, 82 "hostname": "myotherhost", 83 "config": { 84 "total_ram_mib": 4096, 85 "hostname": "localhost" 86 } 87 } 88 }, 89 { 90 "testname":"all environment variables with error in ram", 91 "input_total_ram_mib": 1024, 92 "input_logical_processors": 4, 93 "input_hostname": "myotherhost", 94 "input_environment_variables": { 95 "NEW_RELIC_UTILIZATION_LOGICAL_PROCESSORS": 8, 96 "NEW_RELIC_UTILIZATION_TOTAL_RAM_MIB": "notgood", 97 "NEW_RELIC_UTILIZATION_BILLING_HOSTNAME": "localhost" 98 }, 99 "expected_output_json": { 100 "metadata_version": 3, 101 "logical_processors": 4, 102 "total_ram_mib": 1024, 103 "hostname": "myotherhost", 104 "config": { 105 "logical_processors": 8, 106 "hostname": "localhost" 107 } 108 } 109 }, 110 { 111 "testname": "only agent derived data with aws", 112 "input_total_ram_mib": 2048, 113 "input_logical_processors": 8, 114 "input_hostname": "myotherhost", 115 "input_aws_id": "8BADFOOD", 116 "input_aws_type": "t2.micro", 117 "input_aws_zone": "us-west-1", 118 "expected_output_json": { 119 "metadata_version": 3, 120 "logical_processors": 8, 121 "total_ram_mib": 2048, 122 "hostname": "myotherhost", 123 "vendors": { 124 "aws": { 125 "instanceId": "8BADFOOD", 126 "instanceType": "t2.micro", 127 "availabilityZone": "us-west-1" 128 } 129 } 130 } 131 }, 132 { 133 "testname": "invalid agent derived data with aws", 134 "input_total_ram_mib": 2048, 135 "input_logical_processors": 8, 136 "input_hostname": "myotherhost", 137 "input_aws_id": null, 138 "input_aws_type": "t2.micro", 139 "input_aws_zone": "us-west-1", 140 "expected_output_json": { 141 "metadata_version": 3, 142 "logical_processors": 8, 143 "total_ram_mib": 2048, 144 "hostname": "myotherhost" 145 } 146 }, 147 { 148 "testname": "only agent derived data with gcp", 149 "input_total_ram_mib": 2048, 150 "input_logical_processors": 8, 151 "input_hostname": "myotherhost", 152 "input_gcp_id": "3161347020215157000", 153 "input_gcp_type": "projects/492690098729/machineTypes/custom-1-1024", 154 "input_gcp_name": "aef-default-20170501t160547-7gh8", 155 "input_gcp_zone": "projects/492690098729/zones/us-central1-c", 156 "expected_output_json": { 157 "metadata_version": 3, 158 "logical_processors": 8, 159 "total_ram_mib": 2048, 160 "hostname": "myotherhost", 161 "vendors": { 162 "gcp": { 163 "id": "3161347020215157000", 164 "machineType": "custom-1-1024", 165 "name": "aef-default-20170501t160547-7gh8", 166 "zone": "us-central1-c" 167 } 168 } 169 } 170 }, 171 { 172 "testname": "invalid agent derived data with gcp", 173 "input_total_ram_mib": 2048, 174 "input_logical_processors": 8, 175 "input_hostname": "myotherhost", 176 "input_gcp_id": "3161347020215157000", 177 "input_gcp_type": "projects/492690098729/machineTypes/custom-1-1024", 178 "input_gcp_name": null, 179 "input_gcp_zone": "projects/492690098729/zones/us-central1-c", 180 "expected_output_json": { 181 "metadata_version": 3, 182 "logical_processors": 8, 183 "total_ram_mib": 2048, 184 "hostname": "myotherhost" 185 } 186 }, 187 { 188 "testname": "only agent derived data with pcf", 189 "input_total_ram_mib": 2048, 190 "input_logical_processors": 8, 191 "input_hostname": "myotherhost", 192 "input_pcf_guid": "b977d090-83db-4bdb-793a-bb77", 193 "input_pcf_ip": "10.10.147.130", 194 "input_pcf_mem_limit": "1024m", 195 "expected_output_json": { 196 "metadata_version": 3, 197 "logical_processors": 8, 198 "total_ram_mib": 2048, 199 "hostname": "myotherhost", 200 "vendors": { 201 "pcf": { 202 "cf_instance_guid": "b977d090-83db-4bdb-793a-bb77", 203 "cf_instance_ip": "10.10.147.130", 204 "memory_limit": "1024m" 205 } 206 } 207 } 208 }, 209 { 210 "testname": "invalid agent derived data with pcf", 211 "input_total_ram_mib": 2048, 212 "input_logical_processors": 8, 213 "input_hostname": "myotherhost", 214 "input_pcf_guid": null, 215 "input_pcf_ip": "10.10.147.130", 216 "input_pcf_mem_limit": "1024m", 217 "expected_output_json": { 218 "metadata_version": 3, 219 "logical_processors": 8, 220 "total_ram_mib": 2048, 221 "hostname": "myotherhost" 222 } 223 }, 224 { 225 "testname": "only agent derived data with azure", 226 "input_total_ram_mib": 2048, 227 "input_logical_processors": 8, 228 "input_hostname": "myotherhost", 229 "input_azure_location": "CentralUS", 230 "input_azure_name": "IMDSCanary", 231 "input_azure_id": "5c08b38e-4d57-4c23-ac45-aca61037f084", 232 "input_azure_size": "Standard_DS2", 233 "expected_output_json": { 234 "metadata_version": 3, 235 "logical_processors": 8, 236 "total_ram_mib": 2048, 237 "hostname": "myotherhost", 238 "vendors": { 239 "azure": { 240 "location": "CentralUS", 241 "name": "IMDSCanary", 242 "vmId": "5c08b38e-4d57-4c23-ac45-aca61037f084", 243 "vmSize": "Standard_DS2" 244 } 245 } 246 } 247 }, 248 { 249 "testname": "invalid agent derived data with azure", 250 "input_total_ram_mib": 2048, 251 "input_logical_processors": 8, 252 "input_hostname": "myotherhost", 253 "input_azure_location": "CentralUS", 254 "input_azure_name": "IMDSCanary", 255 "input_azure_id": null, 256 "input_azure_size": "Standard_DS2", 257 "expected_output_json": { 258 "metadata_version": 3, 259 "logical_processors": 8, 260 "total_ram_mib": 2048, 261 "hostname": "myotherhost" 262 } 263 } 264 ]