Showing
1 changed file
with
16 additions
and
6 deletions
@@ -489,12 +489,22 @@ public class TraceAnalyzeHandler implements TraceHandler, Serializable { | @@ -489,12 +489,22 @@ public class TraceAnalyzeHandler implements TraceHandler, Serializable { | ||
489 | ApiTraceResult apiTraceResult = next._2; | 489 | ApiTraceResult apiTraceResult = next._2; |
490 | String[] md5Tags = StringUtils.split(apiTraceResult.getTraceMd5(), '.'); | 490 | String[] md5Tags = StringUtils.split(apiTraceResult.getTraceMd5(), '.'); |
491 | 491 | ||
492 | - Put put = new Put(Bytes.toBytes( md5Tags[1] + ":" + apiTraceResult.getTraceStartTime()/1000 + ":" + apiTraceResult.getTraceId())); | ||
493 | - put.addColumn(Bytes.toBytes("data"), Bytes.toBytes("spans"), Bytes.toBytes(JSONObject.toJSONString(apiTraceResult.getSpans()))); | ||
494 | - put.addColumn(Bytes.toBytes("data"), Bytes.toBytes("traceid"), Bytes.toBytes(apiTraceResult.getTraceId())); | ||
495 | - put.addColumn(Bytes.toBytes("data"), Bytes.toBytes("starttime"), Bytes.toBytes(apiTraceResult.getTraceStartTime()/1000)); | ||
496 | - put.addColumn(Bytes.toBytes("data"), Bytes.toBytes("traceMd5"), Bytes.toBytes(apiTraceResult.getTraceMd5())); | ||
497 | - putList.add(put); | 492 | + Put put1 = new Put(Bytes.toBytes( md5Tags[1] + ":" + apiTraceResult.getTraceStartTime()/1000 + ":" + apiTraceResult.getTraceId())); |
493 | + put1.addColumn(Bytes.toBytes("data"), Bytes.toBytes("spans"), Bytes.toBytes(JSONObject.toJSONString(apiTraceResult.getSpans()))); | ||
494 | + put1.addColumn(Bytes.toBytes("data"), Bytes.toBytes("traceid"), Bytes.toBytes(apiTraceResult.getTraceId())); | ||
495 | + put1.addColumn(Bytes.toBytes("data"), Bytes.toBytes("starttime"), Bytes.toBytes(apiTraceResult.getTraceStartTime()/1000)); | ||
496 | + put1.addColumn(Bytes.toBytes("data"), Bytes.toBytes("traceMd5"), Bytes.toBytes(apiTraceResult.getTraceMd5())); | ||
497 | + put1.addColumn(Bytes.toBytes("data"), Bytes.toBytes("duration"), Bytes.toBytes(apiTraceResult.getDuration())); | ||
498 | + | ||
499 | + | ||
500 | + Put put2 = new Put(Bytes.toBytes( apiTraceResult.getApiName() + ":" + apiTraceResult.getTraceStartTime()/1000 + ":" + apiTraceResult.getTraceId())); | ||
501 | + put2.addColumn(Bytes.toBytes("data"), Bytes.toBytes("spans"), Bytes.toBytes(JSONObject.toJSONString(apiTraceResult.getSpans()))); | ||
502 | + put2.addColumn(Bytes.toBytes("data"), Bytes.toBytes("traceid"), Bytes.toBytes(apiTraceResult.getTraceId())); | ||
503 | + put2.addColumn(Bytes.toBytes("data"), Bytes.toBytes("starttime"), Bytes.toBytes(apiTraceResult.getTraceStartTime()/1000)); | ||
504 | + put2.addColumn(Bytes.toBytes("data"), Bytes.toBytes("traceMd5"), Bytes.toBytes(apiTraceResult.getTraceMd5())); | ||
505 | + put2.addColumn(Bytes.toBytes("data"), Bytes.toBytes("duration"), Bytes.toBytes(apiTraceResult.getDuration())); | ||
506 | + putList.add(put1); | ||
507 | + putList.add(put2); | ||
498 | } | 508 | } |
499 | 509 | ||
500 | resultTable.put(putList); | 510 | resultTable.put(putList); |
-
Please register or login to post a comment