Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated instance art generator test with new network i/o metrics

  • Loading branch information...
commit d2c216a052bfaf2521bc486b36601575622d30f3 1 parent e0a8fde
@kedwards3 kedwards3 authored
View
176 clc/modules/reporting/src/test/java/com/eucalyptus/reporting/art/generator/InstanceArtGeneratorTest.groovy
@@ -33,8 +33,10 @@ class InstanceArtGeneratorTest {
private static String VMTYPE1 = "vmtype1"
private static String VMTYPE2 = "vmtype2"
private static Map<String,String> metricToDimension = [
- "NetworkIn": "total",
- "NetworkOut": "total",
+ "NetworkIn" : "total",
+ "NetworkOut" : "total",
+ "NetworkInExternal": "default",
+ "NetworkOutExternal": "default",
"CPUUtilization": "default",
]
private static Map<String,String> userToAccount = [
@@ -267,6 +269,8 @@ class InstanceArtGeneratorTest {
assertEquals( description + " duration", (long)(durationMultiplier * ms(12)), usage.getDurationMs() );
assertEquals( description + " usage net in", mb(100), usage.getNetTotalInBytes() )
assertEquals( description + " usage net out", mb(200), usage.getNetTotalOutBytes() )
+ assertEquals( description + " usage net external in", mb(100), usage.getNetExternalInBytes() )
+ assertEquals( description + " usage net external out", mb(200), usage.getNetExternalOutBytes() )
assertEquals( description + " usage cpu ms", ms(6), usage.getCpuUtilizationMs() )
assertEquals( description + " usage disk read ops", diskUsageMultiplier * 50000, usage.getDiskReadOps() )
assertEquals( description + " usage disk write ops", diskUsageMultiplier * 20000, usage.getDiskWriteOps() )
@@ -279,8 +283,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> usageBeforeReportPeriod() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-08-01T01:00:01", 0, [
- "NetworkIn": 0,
- "NetworkOut": 0,
+ "NetworkIn" : 0,
+ "NetworkOut" : 0,
+ "NetworkInExternal" : 0,
+ "NetworkOutExternal" : 0,
"CPUUtilization": 0,
], [ "vda": [
"DiskReadOps": 0,
@@ -296,8 +302,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> basicUsageInReportPeriod() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T00:00:00", 1, [
- "NetworkIn": 0,
- "NetworkOut": 0,
+ "NetworkIn" : 0,
+ "NetworkOut" : 0,
+ "NetworkInExternal" : 0,
+ "NetworkOutExternal" : 0,
"CPUUtilization": 0,
], [ "vda": [
"DiskReadOps": 0,
@@ -308,8 +316,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 0,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 2, [
- "NetworkIn": mbd(100),
- "NetworkOut": mbd(200),
+ "NetworkIn" : mbd(100),
+ "NetworkOut" : mbd(200),
+ "NetworkInExternal" : mbd(100),
+ "NetworkOutExternal" : mbd(200),
"CPUUtilization": msd(6),
], [ "vda": [
"DiskReadOps": 50000,
@@ -326,8 +336,10 @@ class InstanceArtGeneratorTest {
List<ReportingInstanceUsageEvent> instanceUsageList = []
[ INSTANCE1, INSTANCE2 ].each{ instance ->
addUsage( instanceUsageList, instance, "2012-09-01T00:00:00", 1, [
- "NetworkIn": 0,
- "NetworkOut": 0,
+ "NetworkIn" : 0,
+ "NetworkOut" : 0,
+ "NetworkInExternal" : 0,
+ "NetworkOutExternal" : 0,
"CPUUtilization": 0,
], [ "vda": [
"DiskReadOps": 0,
@@ -338,8 +350,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 0,
] ] )
addUsage( instanceUsageList, instance, "2012-09-01T12:00:00", 2, [
- "NetworkIn": mbd(100),
- "NetworkOut": mbd(200),
+ "NetworkIn" : mbd(100),
+ "NetworkOut" : mbd(200),
+ "NetworkInExternal" : mbd(100),
+ "NetworkOutExternal" : mbd(200),
"CPUUtilization": msd(6),
], [ "vda": [
"DiskReadOps": 50000,
@@ -356,8 +370,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> basicUsageInReportPeriodWithMultipleDisks() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T00:00:00", 1, [
- "NetworkIn": 0,
- "NetworkOut": 0,
+ "NetworkIn" : 0,
+ "NetworkOut" : 0,
+ "NetworkInExternal" : 0,
+ "NetworkOutExternal" : 0,
"CPUUtilization": 0,
], [ "vda": [
"DiskReadOps": 0,
@@ -375,8 +391,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 0,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 2, [
- "NetworkIn": mbd(100),
- "NetworkOut": mbd(200),
+ "NetworkIn" : mbd(100),
+ "NetworkOut": mbd(200),
+ "NetworkInExternal" : mbd(100),
+ "NetworkOutExternal": mbd(200),
"CPUUtilization": msd(6),
], [ "vda": [
"DiskReadOps": 50000,
@@ -399,8 +417,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> basicUsageMultipleEvents() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T00:00:00", 3, [
- "NetworkIn": 0,
- "NetworkOut": 0,
+ "NetworkIn" : 0,
+ "NetworkOut" : 0,
+ "NetworkInExternal" : 0,
+ "NetworkOutExternal" : 0,
"CPUUtilization": 0,
], [ "vda": [
"DiskReadOps": 0,
@@ -411,8 +431,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 0,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T01:00:00", 4, [
- "NetworkIn": mbd(12),
- "NetworkOut": mbd(23),
+ "NetworkIn" : mbd(12),
+ "NetworkOut" : mbd(23),
+ "NetworkInExternal" : mbd(12),
+ "NetworkOutExternal" : mbd(23),
"CPUUtilization": msd(1),
], [ "vda": [
"DiskReadOps": 5000,
@@ -423,8 +445,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 200,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T06:00:00", 5, [
- "NetworkIn": mbd(50),
- "NetworkOut": mbd(100),
+ "NetworkIn" : mbd(50),
+ "NetworkOut" : mbd(100),
+ "NetworkInExternal" : mbd(50),
+ "NetworkOutExternal" : mbd(100),
"CPUUtilization": msd(3),
], [ "vda": [
"DiskReadOps": 25000,
@@ -435,8 +459,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 2000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T09:00:00", 6, [
- "NetworkIn": mbd(80),
- "NetworkOut": mbd(140),
+ "NetworkIn" : mbd(80),
+ "NetworkOut" : mbd(140),
+ "NetworkInExternal" : mbd(80),
+ "NetworkOutExternal" : mbd(140),
"CPUUtilization": msd(4),
], [ "vda": [
"DiskReadOps": 45000,
@@ -447,8 +473,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 3000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 7, [
- "NetworkIn": mbd(100),
- "NetworkOut": mbd(200),
+ "NetworkIn" : mbd(100),
+ "NetworkOut" : mbd(200),
+ "NetworkInExternal" : mbd(100),
+ "NetworkOutExternal" : mbd(200),
"CPUUtilization": msd(6),
], [ "vda": [
"DiskReadOps": 50000,
@@ -466,8 +494,10 @@ class InstanceArtGeneratorTest {
int multiplier ) {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, usage1Timestamp, 1, [
- "NetworkIn": 0,
- "NetworkOut": 0,
+ "NetworkIn" : 0,
+ "NetworkOut" : 0,
+ "NetworkInExternal" : 0,
+ "NetworkOutExternal" : 0,
"CPUUtilization": 0,
], [ "vda": [
"DiskReadOps": 0,
@@ -478,8 +508,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 0,
] ] )
addUsage( instanceUsageList, INSTANCE1, usage2Timestamp, 2, [
- "NetworkIn": mbd(multiplier * 100),
- "NetworkOut": mbd(multiplier * 200),
+ "NetworkIn" : mbd(multiplier * 100),
+ "NetworkOut" : mbd(multiplier * 200),
+ "NetworkInExternal" : mbd(multiplier * 100),
+ "NetworkOutExternal" : mbd(multiplier * 200),
"CPUUtilization": msd(multiplier * 6),
], [ "vda": [
"DiskReadOps": multiplier * 50000,
@@ -495,8 +527,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> sequenceResetUsageExiting() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T00:00:00", 100, [
- "NetworkIn": 0,
- "NetworkOut": 0,
+ "NetworkIn" : 0,
+ "NetworkOut" : 0,
+ "NetworkInExternal" : 0,
+ "NetworkOutExternal" : 0,
"CPUUtilization": 0,
], [ "vda": [
"DiskReadOps": 0,
@@ -507,8 +541,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 0,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T06:00:00", 101, [
- "NetworkIn": mbd(50),
- "NetworkOut": mbd(100),
+ "NetworkIn" : mbd(50),
+ "NetworkOut" : mbd(100),
+ "NetworkInExternal" : mbd(50),
+ "NetworkOutExternal" : mbd(100),
"CPUUtilization": msd(3),
], [ "vda": [
"DiskReadOps": 25000,
@@ -519,8 +555,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 2000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 1, [
- "NetworkIn": mbd(50),
- "NetworkOut": mbd(100),
+ "NetworkIn" : mbd(50),
+ "NetworkOut" : mbd(100),
+ "NetworkInExternal" : mbd(50),
+ "NetworkOutExternal" : mbd(100),
"CPUUtilization": msd(3),
], [ "vda": [
"DiskReadOps": 25000,
@@ -536,8 +574,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> sequenceResetUsage() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T00:00:00", 1, [
- "NetworkIn": mbd(50),
- "NetworkOut": mbd(50),
+ "NetworkIn" : mbd(50),
+ "NetworkOut" : mbd(50),
+ "NetworkInExternal" : mbd(50),
+ "NetworkOutExternal" : mbd(50),
"CPUUtilization": msd(3),
], [ "vda": [
"DiskReadOps": 25000,
@@ -548,8 +588,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 2000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T06:00:00", 0, [
- "NetworkIn": mbd(50),
- "NetworkOut": mbd(100),
+ "NetworkIn" : mbd(50),
+ "NetworkOut" : mbd(100),
+ "NetworkInExternal" : mbd(50),
+ "NetworkOutExternal" : mbd(100),
"CPUUtilization": msd(3),
], [ "vda": [
"DiskReadOps": 25000,
@@ -560,8 +602,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 2000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T09:00:00", 0, [
- "NetworkIn": mbd(50),
- "NetworkOut": mbd(100),
+ "NetworkIn" : mbd(50),
+ "NetworkOut" : mbd(100),
+ "NetworkInExternal" : mbd(50),
+ "NetworkOutExternal" : mbd(100),
"CPUUtilization": msd(3),
], [ "vda": [
"DiskReadOps": 25000,
@@ -572,8 +616,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 2000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 1, [
- "NetworkIn": mbd(50),
- "NetworkOut": mbd(100),
+ "NetworkIn" : mbd(50),
+ "NetworkOut" : mbd(100),
+ "NetworkInExternal" : mbd(50),
+ "NetworkOutExternal" : mbd(100),
"CPUUtilization": msd(3),
], [ "vda": [
"DiskReadOps": 25000,
@@ -589,8 +635,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> sequenceResetUsageEntering() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-08-31T23:00:00", 100, [
- "NetworkIn": mbd(500000),
- "NetworkOut": mbd(500000),
+ "NetworkIn" : mbd(500000),
+ "NetworkOut" : mbd(500000),
+ "NetworkInExternal" : mbd(500000),
+ "NetworkOutExternal" : mbd(500000),
"CPUUtilization": msd(3000),
], [ "vda": [
"DiskReadOps": 1000000,
@@ -601,8 +649,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 1000000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T01:00:00", 0, [
- "NetworkIn": mbd(100),
- "NetworkOut": mbd(200),
+ "NetworkIn" : mbd(100),
+ "NetworkOut" : mbd(200),
+ "NetworkInExternal" : mbd(100),
+ "NetworkOutExternal" : mbd(200),
"CPUUtilization": msd(6),
], [ "vda": [
"DiskReadOps": 50000,
@@ -613,8 +663,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 4000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 1, [
- "NetworkIn": mbd(150),
- "NetworkOut": mbd(300),
+ "NetworkIn" : mbd(150),
+ "NetworkOut" : mbd(300),
+ "NetworkInExternal" : mbd(150),
+ "NetworkOutExternal" : mbd(300),
"CPUUtilization": msd(9),
], [ "vda": [
"DiskReadOps": 75000,
@@ -630,8 +682,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> createdInReportUsage() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 0, [
- "NetworkIn": mbd(100),
- "NetworkOut": mbd(200),
+ "NetworkIn" : mbd(100),
+ "NetworkOut" : mbd(200),
+ "NetworkInExternal" : mbd(100),
+ "NetworkOutExternal" : mbd(200),
"CPUUtilization": msd(6),
], [ "vda": [
"DiskReadOps": 50000,
@@ -647,8 +701,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> createdEnteringReportUsage() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 0, [
- "NetworkIn": mbd(200),
- "NetworkOut": mbd(400),
+ "NetworkIn" : mbd(200),
+ "NetworkOut" : mbd(400),
+ "NetworkInExternal" : mbd(200),
+ "NetworkOutExternal" : mbd(400),
"CPUUtilization": msd(12),
], [ "vda": [
"DiskReadOps": 100000,
@@ -664,8 +720,10 @@ class InstanceArtGeneratorTest {
private List<ReportingInstanceUsageEvent> createdBeforeUsage() {
List<ReportingInstanceUsageEvent> instanceUsageList = []
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T06:00:00", 0, [
- "NetworkIn": mbd(100),
- "NetworkOut": mbd(200),
+ "NetworkIn" : mbd(100),
+ "NetworkOut" : mbd(200),
+ "NetworkInExternal" : mbd(100),
+ "NetworkOutExternal" : mbd(200),
"CPUUtilization": msd(6),
], [ "vda": [
"DiskReadOps": 50000,
@@ -676,8 +734,10 @@ class InstanceArtGeneratorTest {
"VolumeTotalWriteTime": 4000,
] ] )
addUsage( instanceUsageList, INSTANCE1, "2012-09-01T12:00:00", 1, [
- "NetworkIn": mbd(100),
- "NetworkOut": mbd(200),
+ "NetworkIn" : mbd(100),
+ "NetworkOut" : mbd(200),
+ "NetworkInExternal" : mbd(100),
+ "NetworkOutExternal" : mbd(200),
"CPUUtilization": msd(6),
], [ "vda": [
"DiskReadOps": 50000,
Please sign in to comment.
Something went wrong with that request. Please try again.