@SuppressWarnings("unchecked") public void testHBaseRegionServerProcessor() { // test metric for each record type JSONObject json = getJSONObject(); json.put("blockCacheSize", "2681872"); byte[] data = json.toString().getBytes(); HBaseMasterProcessor p = new HBaseMasterProcessor(); ChunkImpl ch = new ChunkImpl("TestType", "Test", data.length, data, null); String failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); // no gauge metrics yet }
@SuppressWarnings("unchecked") public void testDatanodeProcessor() { // test metric for each record type JSONObject json = getJSONObject(); json.put("heartBeats_num_ops", "10875"); json.put("FilesCreated", "33"); json.put("RpcQueueTime_avg_time", "0.001"); json.put("gcCount", "112"); json.put("Capacity", "22926269645"); byte[] data = json.toString().getBytes(); DatanodeProcessor p = new DatanodeProcessor(); ChunkImpl ch = new ChunkImpl("TestType", "Test", data.length, data, null); String failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); // test gauge metric json.put("heartBeats_num_ops", "10980"); json.put("gcCount", "115"); data = json.toString().getBytes(); ch = new ChunkImpl("TestType", "Test", data.length, data, null); json.put("heartBeats_num_ops", "105"); json.put("gcCount", "3"); failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); }
@SuppressWarnings("unchecked") public void testNamenodeProcessor() { // test metric for each record type JSONObject json = getJSONObject(); json.put("BlocksTotal", "1234"); json.put("FilesCreated", "33"); json.put("RpcQueueTime_avg_time", "0.001"); json.put("gcCount", "112"); json.put("Transactions_num_ops", "3816"); byte[] data = json.toString().getBytes(); NamenodeProcessor p = new NamenodeProcessor(); ChunkImpl ch = new ChunkImpl("TestType", "Test", data.length, data, null); String failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); // test gauge metric json.put("FilesCreated", "55"); json.put("gcCount", "115"); data = json.toString().getBytes(); ch = new ChunkImpl("TestType", "Test", data.length, data, null); json.put("FilesCreated", "22"); json.put("gcCount", "3"); failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); }
@SuppressWarnings("unchecked") public void testJobTrackerProcessor() { // test metric for each record type JSONObject json = getJSONObject(); json.put("memHeapUsedM", "286"); json.put("maps_killed", "3"); json.put("waiting_maps", "1"); json.put("RpcProcessingTime_avg_time", "0.003"); byte[] data = json.toString().getBytes(); JobTrackerProcessor p = new JobTrackerProcessor(); ChunkImpl ch = new ChunkImpl("TestType", "Test", data.length, data, null); String failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); // test gauge metric json.put("maps_killed", "5"); data = json.toString().getBytes(); ch = new ChunkImpl("TestType", "Test", data.length, data, null); json.put("maps_killed", "2"); failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); }
@SuppressWarnings("unchecked") public void testHBaseMasterProcessor() { // test metric for each record type JSONObject json = getJSONObject(); json.put("splitSizeNumOps", "108"); json.put("AverageLoad", "3.33"); byte[] data = json.toString().getBytes(); HBaseMasterProcessor p = new HBaseMasterProcessor(); ChunkImpl ch = new ChunkImpl("TestType", "Test", data.length, data, null); String failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); // test gauge metric json.put("splitSizeNumOps", "109"); data = json.toString().getBytes(); ch = new ChunkImpl("TestType", "Test", data.length, data, null); json.put("splitSizeNumOps", "1"); failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); }
@SuppressWarnings("unchecked") public void testZookeeperProcessor() { // test metric for each record type JSONObject json = getJSONObject(); json.put("packetsSent", "2049"); json.put("NodeCount", "40"); byte[] data = json.toString().getBytes(); ZookeeperProcessor p = new ZookeeperProcessor(); ChunkImpl ch = new ChunkImpl("TestType", "Test", data.length, data, null); String failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); // test gauge metric json.put("packetsSent", "2122"); data = json.toString().getBytes(); ch = new ChunkImpl("TestType", "Test", data.length, data, null); json.put("packetsSent", "73"); failMsg = testProcessor(p, json, ch); assertNull(failMsg, failMsg); }