test_class.declarator: log = LoggerFactory.getLogger(GoogleMonitoringIngesterTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger log = LoggerFactory.getLogger(GoogleMonitoringIngesterTest.class);
test_class.type: Logger
test_class.var_name: log
test_class.declarator: conf
test_class.modifier: private
test_class.original_string: private MacroBaseConf conf;
test_class.type: MacroBaseConf
test_class.var_name: conf
test_class.file: contrib/src/test/java/macrobase/ingest/GoogleMonitoringIngesterTest.java
test_class.identifier: GoogleMonitoringIngesterTest
test_case.body: @Test
      public void testConvertToStream() throws Exception {
          Map<String, Map<String, Record>> byTime = new TreeMap<>();
  
          Record record1 = new Record();
          record1.attributes = new TreeMap<>();
          record1.attributes.put("attr1", "foo");
          record1.attributes.put("attr2", "bar");
          record1.values = new HashMap<>();
          record1.values.put("custom.googleapis.com/test", 77.0);
  
          Record record2 = new Record();
          record2.attributes = new TreeMap<>();
          record2.attributes.put("attr1", "foo");
          record2.attributes.put("attr2", "baz");
          record2.values = new HashMap<>();
          record2.values.put("custom.googleapis.com/test", 88.0);
  
          // This record is incomplete and should be skipped.
          Record record3 = new Record();
          record3.attributes = new TreeMap<>();
          record3.attributes.put("attr1", "foo");
          record3.attributes.put("attr2", "bar");
          record3.values = new HashMap<>();
  
          Record record4 = new Record();
          record4.attributes = new TreeMap<>();
          record4.attributes.put("attr1", "foo");
          record4.attributes.put("attr2", "bar");
          record4.values = new HashMap<>();
          record4.values.put("custom.googleapis.com/test", 99.0);
  
          Map<String, Record> recordMap1 = new HashMap<>();
          recordMap1.put("attr-map-key1", record1);
          recordMap1.put("attr-map-key2", record2);
  
          Map<String, Record> recordMap2 = new HashMap<>();
          recordMap2.put("attr-map-key1", record3);
  
          Map<String, Record> recordMap3 = new HashMap<>();
          recordMap3.put("attr-map-key1", record4);
  
          byTime.put("2016-08-08T00:00:00Z", recordMap1);
          byTime.put("2016-08-08T00:00:01Z", recordMap2);
          byTime.put("2016-08-08T00:00:02Z", recordMap3);
  
          GoogleMonitoringIngester ingester = new GoogleMonitoringIngester(conf);
          MBStream<Datum> stream = ingester.convertToStream(byTime);
  
          List<Datum> data = stream.drain();
          assertEquals(3, data.size(), 0.0);
  
          assertEquals(77, data.get(0).metrics().getEntry(0), 0.0);
          assertEquals(0, data.get(0).attributes().get(0), 0.0);
          assertEquals(1, data.get(0).attributes().get(1), 0.0);
  
          assertEquals(88, data.get(1).metrics().getEntry(0), 0.0);
          assertEquals(0, data.get(1).attributes().get(0), 0.0);
          assertEquals(2, data.get(1).attributes().get(1), 0.0);
  
          assertEquals(99, data.get(2).metrics().getEntry(0), 0.0);
          assertEquals(0, data.get(2).attributes().get(0), 0.0);
          assertEquals(1, data.get(2).attributes().get(1), 0.0);
      }
test_case.class_method_signature: GoogleMonitoringIngesterTest.testConvertToStream()
test_case.full_signature: @Test public void testConvertToStream()
test_case.identifier: testConvertToStream
test_case.invocations: put put put put put put put put put put put put put put put put put put convertToStream drain assertEquals size assertEquals getEntry metrics get assertEquals get attributes get assertEquals get attributes get assertEquals getEntry metrics get assertEquals get attributes get assertEquals get attributes get assertEquals getEntry metrics get assertEquals get attributes get assertEquals get attributes get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testConvertToStream()
focal_class.declarator: log = LoggerFactory.getLogger(GoogleMonitoringIngester.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(GoogleMonitoringIngester.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: GOOGLE_MONITORING_QUERIES = "macrobase.loader.googlemonitoring.queries"
focal_class.modifier: public static final
focal_class.original_string: public static final String GOOGLE_MONITORING_QUERIES = "macrobase.loader.googlemonitoring.queries";
focal_class.type: String
focal_class.var_name: GOOGLE_MONITORING_QUERIES
focal_class.declarator: GOOGLE_MONITORING_START_TIME = "macrobase.loader.googlemonitoring.startTime"
focal_class.modifier: public static final
focal_class.original_string: public static final String GOOGLE_MONITORING_START_TIME = "macrobase.loader.googlemonitoring.startTime";
focal_class.type: String
focal_class.var_name: GOOGLE_MONITORING_START_TIME
focal_class.declarator: GOOGLE_MONITORING_END_TIME = "macrobase.loader.googlemonitoring.endTime"
focal_class.modifier: public static final
focal_class.original_string: public static final String GOOGLE_MONITORING_END_TIME = "macrobase.loader.googlemonitoring.endTime";
focal_class.type: String
focal_class.var_name: GOOGLE_MONITORING_END_TIME
focal_class.declarator: dataStream
focal_class.modifier: private
focal_class.original_string: private MBStream<Datum> dataStream;
focal_class.type: MBStream<Datum>
focal_class.var_name: dataStream
focal_class.declarator: loaded = false
focal_class.modifier: private
focal_class.original_string: private boolean loaded = false;
focal_class.type: boolean
focal_class.var_name: loaded
focal_class.declarator: pointsAdded = 0
focal_class.modifier: private
focal_class.original_string: private int pointsAdded = 0;
focal_class.type: int
focal_class.var_name: pointsAdded
focal_class.declarator: skippedTimeSeries = 0
focal_class.modifier: private
focal_class.original_string: private int skippedTimeSeries = 0;
focal_class.type: int
focal_class.var_name: skippedTimeSeries
focal_class.declarator: skippedPoints = 0
focal_class.modifier: private
focal_class.original_string: private int skippedPoints = 0;
focal_class.type: int
focal_class.var_name: skippedPoints
focal_class.file: contrib/src/main/java/macrobase/ingest/GoogleMonitoringIngester.java
focal_class.identifier: GoogleMonitoringIngester
focal_class.class_method_signature: GoogleMonitoringIngester.GoogleMonitoringIngester(MacroBaseConf conf)
focal_class.full_signature: public  GoogleMonitoringIngester(MacroBaseConf conf)
focal_class.identifier: GoogleMonitoringIngester
focal_class.modifiers: public
focal_class.parameters: (MacroBaseConf conf)
focal_class.signature:  GoogleMonitoringIngester(MacroBaseConf conf)
focal_class.class_method_signature: GoogleMonitoringIngester.getStream()
focal_class.full_signature: @Override public MBStream<Datum> getStream()
focal_class.identifier: getStream
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: MBStream<Datum>
focal_class.signature: MBStream<Datum> getStream()
focal_class.class_method_signature: GoogleMonitoringIngester.getQueries(String queryJson)
focal_class.full_signature:  QueryConf getQueries(String queryJson)
focal_class.identifier: getQueries
focal_class.parameters: (String queryJson)
focal_class.return: QueryConf
focal_class.signature: QueryConf getQueries(String queryJson)
focal_class.class_method_signature: GoogleMonitoringIngester.processResponse(ListTimeSeriesResponse response, List<String> allMetrics,
                           Map<String, Map<String, Record>> byTime)
focal_class.full_signature:  void processResponse(ListTimeSeriesResponse response, List<String> allMetrics,
                           Map<String, Map<String, Record>> byTime)
focal_class.identifier: processResponse
focal_class.parameters: (ListTimeSeriesResponse response, List<String> allMetrics,
                           Map<String, Map<String, Record>> byTime)
focal_class.return: void
focal_class.signature: void processResponse(ListTimeSeriesResponse response, List<String> allMetrics,
                           Map<String, Map<String, Record>> byTime)
focal_class.class_method_signature: GoogleMonitoringIngester.processRecord(Record rec)
focal_class.full_signature:  Datum processRecord(Record rec)
focal_class.identifier: processRecord
focal_class.parameters: (Record rec)
focal_class.return: Datum
focal_class.signature: Datum processRecord(Record rec)
focal_class.class_method_signature: GoogleMonitoringIngester.convertToStream(Map<String, Map<String, Record>> byTime)
focal_class.full_signature:  MBStream<Datum> convertToStream(Map<String, Map<String, Record>> byTime)
focal_class.identifier: convertToStream
focal_class.parameters: (Map<String, Map<String, Record>> byTime)
focal_class.return: MBStream<Datum>
focal_class.signature: MBStream<Datum> convertToStream(Map<String, Map<String, Record>> byTime)
focal_class.class_method_signature: GoogleMonitoringIngester.buildClient()
focal_class.full_signature: private Monitoring buildClient()
focal_class.identifier: buildClient
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Monitoring
focal_class.signature: Monitoring buildClient()
focal_class.superclass: extends DataIngester
focal_method.body: MBStream<Datum> convertToStream(Map<String, Map<String, Record>> byTime) {
          MBStream<Datum> stream = new MBStream<>();
          for (Entry<String, Map<String, Record>> entry : byTime.entrySet()) {
              for (Record rec : entry.getValue().values()) {
                  try {
                      stream.add(processRecord(rec));
                      ++pointsAdded;
                  } catch (Exception e) {
                      // The record was incomplete.
                      ++skippedPoints;
                  }
              }
          }
  
          return stream;
      }
focal_method.class_method_signature: GoogleMonitoringIngester.convertToStream(Map<String, Map<String, Record>> byTime)
focal_method.full_signature:  MBStream<Datum> convertToStream(Map<String, Map<String, Record>> byTime)
focal_method.identifier: convertToStream
focal_method.invocations: entrySet values getValue add processRecord
focal_method.parameters: (Map<String, Map<String, Record>> byTime)
focal_method.return: MBStream<Datum>
focal_method.signature: MBStream<Datum> convertToStream(Map<String, Map<String, Record>> byTime)