use of org.gridkit.jvmtool.event.SimpleTagCollection in project jvm-tools by aragozin.
the class SimpleTagCollectionTest method simple_ops.
@Test
public void simple_ops() {
SimpleTagCollection tags = new SimpleTagCollection();
tags.put("A", "1");
tags.put("B", "1");
tags.put("B", "2");
tags.put("B", "3");
assertThat(tags).containsExactly("A", "B");
assertThat(tags.tagsFor("A")).containsExactly("1");
assertThat(tags.tagsFor("B")).containsExactly("1", "2", "3");
}
use of org.gridkit.jvmtool.event.SimpleTagCollection in project jvm-tools by aragozin.
the class SimpleTagCollectionTest method empty_tag.
@Test
public void empty_tag() {
SimpleTagCollection tags = new SimpleTagCollection();
tags.put("A", "");
assertThat(tags).containsExactly("A");
assertThat(tags.tagsFor("A")).containsExactly("");
}
use of org.gridkit.jvmtool.event.SimpleTagCollection in project jvm-tools by aragozin.
the class SimpleTagCollectionTest method removal_ops.
@Test
public void removal_ops() {
SimpleTagCollection tags = new SimpleTagCollection();
tags.put("A", "1");
tags.put("B", "1");
tags.put("B", "2");
tags.put("B", "3");
tags.put("D", "0");
assertThat(tags).containsExactly("A", "B", "D");
assertThat(tags.tagsFor("A")).containsExactly("1");
assertThat(tags.tagsFor("B")).containsExactly("1", "2", "3");
assertThat(tags.tagsFor("D")).containsExactly("0");
tags.remove("B", "2");
assertThat(tags).containsExactly("A", "B", "D");
assertThat(tags.tagsFor("A")).containsExactly("1");
assertThat(tags.tagsFor("B")).containsExactly("1", "3");
assertThat(tags.tagsFor("D")).containsExactly("0");
tags.remove("B");
assertThat(tags).containsExactly("A", "D");
assertThat(tags.tagsFor("A")).containsExactly("1");
assertThat(tags.tagsFor("B")).isEmpty();
assertThat(tags.tagsFor("D")).containsExactly("0");
}
use of org.gridkit.jvmtool.event.SimpleTagCollection in project jvm-tools by aragozin.
the class StackTraceEventReaderV4 method readCounterSet.
protected void readCounterSet() throws IOException {
int n = StackTraceCodec.readVarInt(dis);
int base = StackTraceCodec.readVarInt(dis);
SimpleTagCollection ts = new SimpleTagCollection(counterDic.get(base).definition);
readTagSetDelta(ts);
ensureSlot(counterDic, n);
CounterSet cs = new CounterSet(ts);
counterDic.set(n, cs);
}
use of org.gridkit.jvmtool.event.SimpleTagCollection in project jvm-tools by aragozin.
the class StackTraceEventReaderV4 method readEvent.
protected void readEvent() throws IOException {
threadDetails = false;
TagCollection tc = tagDic.get(StackTraceCodec.readVarInt(dis));
tags = new SimpleTagCollection(tc);
// timestamp
readEventTimestamp();
// counters
readEventCounters();
// thread stack trace
readEventStackTrace();
// wipe encoding tags
tags.remove(StackTraceCodec.TK_PART);
}
Aggregations