use of zipkin.storage.InMemoryStorage in project zipkin by openzipkin.
the class ScribeCollectorTest method check_failsWhenNotStarted.
@Test
public void check_failsWhenNotStarted() {
try (ScribeCollector scribe = ScribeCollector.builder().storage(new InMemoryStorage()).port(12345).build()) {
CheckResult result = scribe.check();
assertThat(result.ok).isFalse();
assertThat(result.exception).isInstanceOf(IllegalStateException.class);
scribe.start();
assertThat(scribe.check().ok).isTrue();
}
}
use of zipkin.storage.InMemoryStorage in project zipkin by openzipkin.
the class CassandraDependenciesTest method processDependencies.
/**
* The current implementation does not include dependency aggregation. It includes retrieval of
* pre-aggregated links.
*
* <p>This uses {@link InMemorySpanStore} to prepare links and {@link CassandraDependenciesWriter}
* to store them.
*
* <p>Note: The zipkin-dependencies-spark doesn't use any of these classes: it reads and writes to
* the keyspace directly.
*/
@Override
public void processDependencies(List<Span> spans) {
InMemoryStorage mem = new InMemoryStorage();
mem.spanConsumer().accept(spans);
List<DependencyLink> links = mem.spanStore().getDependencies(TODAY + DAY, null);
// This gets or derives a timestamp from the spans
long midnight = midnightUTC(MergeById.apply(spans).get(0).timestamp / 1000);
new CassandraDependenciesWriter(storage.session.get()).write(links, midnight);
}
use of zipkin.storage.InMemoryStorage in project zipkin by openzipkin.
the class ElasticsearchHttpDependenciesTest method processDependencies.
/**
* The current implementation does not include dependency aggregation. It includes retrieval of
* pre-aggregated links.
*/
@Override
public void processDependencies(List<Span> spans) {
InMemoryStorage mem = new InMemoryStorage();
mem.spanConsumer().accept(spans);
List<DependencyLink> links = mem.spanStore().getDependencies(TODAY + DAY, null);
// This gets or derives a timestamp from the spans
long midnightUTC = midnightUTC(guessTimestamp(MergeById.apply(spans).get(0)) / 1000);
InternalForTests.writeDependencyLinks(storage(), links, midnightUTC);
}
use of zipkin.storage.InMemoryStorage in project zipkin by openzipkin.
the class ElasticsearchDependenciesTest method processDependencies.
/**
* The current implementation does not include dependency aggregation. It includes retrieval of
* pre-aggregated links.
*
* <p>This uses {@link InMemorySpanStore} to prepare links and {@link #writeDependencyLinks(List,
* long)}} to store them.
*/
@Override
public void processDependencies(List<Span> spans) {
InMemoryStorage mem = new InMemoryStorage();
mem.spanConsumer().accept(spans);
List<DependencyLink> links = mem.spanStore().getDependencies(TODAY + DAY, null);
// This gets or derives a timestamp from the spans
long midnight = midnightUTC(guessTimestamp(MergeById.apply(spans).get(0)) / 1000);
writeDependencyLinks(links, midnight);
}
use of zipkin.storage.InMemoryStorage in project zipkin by openzipkin.
the class CassandraDependenciesTest method processDependencies.
/**
* The current implementation does not include dependency aggregation. It includes retrieval of
* pre-aggregated links.
*
* <p>This uses {@link InMemorySpanStore} to prepare links and {@link CassandraDependenciesWriter}
* to store them.
*
* <p>Note: The zipkin-dependencies-spark doesn't use any of these classes: it reads and writes to
* the keyspace directly.
*/
@Override
public void processDependencies(List<Span> spans) {
InMemoryStorage mem = new InMemoryStorage();
mem.spanConsumer().accept(spans);
List<DependencyLink> links = mem.spanStore().getDependencies(TODAY + DAY, null);
// This gets or derives a timestamp from the spans
long midnight = midnightUTC(guessTimestamp(MergeById.apply(spans).get(0)) / 1000);
new CassandraDependenciesWriter(storage.session.get()).write(links, midnight);
}
Aggregations