pub struct Telemetry {
pub test_id: String,
pub spans: Vec<Span>,
pub logs: Vec<Log>,
pub strays: Vec<Span>,
pub recording: String,
}Expand description
What a test session recorded for one test.
Fields§
§test_id: StringThe test’s id.
spans: Vec<Span>Every span of every trace the test caused, by start: the test’s own trace, and that of each delivery of a message published for it.
logs: Vec<Log>The lines the services logged in those traces, and what Encore captured of their requests, by time.
strays: Vec<Span>The calls between services made while the test ran that carried no test, and no trace of their request’s to place them by: each the request Encore handed the service called. A service that calls another without its request’s context loses the test with it, and what the service called then does is done on the data the services share, not on the test’s. Any of these may be this test’s doing, or that of another running beside it.
recording: StringThe file the recording of the test’s browser is written to when the test ends, for a test that has a browser whose recording is kept: one HTML file that plays its pages back beside what the test and the app did. Empty otherwise.
Implementations§
Source§impl Telemetry
impl Telemetry
Sourcepub fn decode(
test_id: &str,
spans: &[u8],
logs: &[u8],
own: Option<OwnSpan<'_>>,
) -> Result<Telemetry, Error>
pub fn decode( test_id: &str, spans: &[u8], logs: &[u8], own: Option<OwnSpan<'_>>, ) -> Result<Telemetry, Error>
Reads what the session answered a telemetry request with: spans,
an encoded ExportTraceServiceRequest, and logs, an encoded
ExportLogsServiceRequest. own is the test’s span, added where
the session does not have it.
Sourcepub fn requests(&self) -> Requests<'_> ⓘ
pub fn requests(&self) -> Requests<'_> ⓘ
The requests services were handed, and gateways took, in order.
Narrowed by Requests::service, Requests::endpoint and
Requests::caller:
assert_eq!(recorded.requests().service("catalog").caller("test").count(), 1);Sourcepub fn queries(&self) -> Queries<'_> ⓘ
pub fn queries(&self) -> Queries<'_> ⓘ
The queries run on the app’s databases, in order. Narrowed by
Queries::database.
Sourcepub fn publishes(&self) -> Publishes<'_> ⓘ
pub fn publishes(&self) -> Publishes<'_> ⓘ
The messages published, in order. Narrowed by Publishes::topic.
Sourcepub fn deliveries(&self) -> Deliveries<'_> ⓘ
pub fn deliveries(&self) -> Deliveries<'_> ⓘ
The deliveries of messages to subscriptions, an attempt each, in
order. Narrowed by Deliveries::topic and
Deliveries::subscription.
Sourcepub fn errors(&self) -> Vec<String>
pub fn errors(&self) -> Vec<String>
What went wrong in what the test caused, a line each: requests answered with a server error, spans that failed, deliveries the handler did not handle, calls between services that lost their request’s context, and lines logged as errors.
Sourcepub fn lost_context(&self) -> Vec<LostContext>
pub fn lost_context(&self) -> Vec<LostContext>
The calls between services that lost their request’s context, and
with it the test: those in the test’s own traces
(of_test), which a service made for the
test, then those that are only known to have been made while it ran
(strays), each kind of call once.
What a service does for a call that carries no test it does on the data the services share: a test that finds its own data without what it expected finds why here.
Sourcepub fn with_strays(self, strays: &[u8]) -> Telemetry
pub fn with_strays(self, strays: &[u8]) -> Telemetry
With the spans of the calls that carried no test while the test ran,
as the session answers them: an encoded OTLP
ExportTraceServiceRequest. What cannot be read is none.
Sourcepub fn with_recording(self, recording: String) -> Telemetry
pub fn with_recording(self, recording: String) -> Telemetry
With where the recording of the test’s browser will be, as the session answers it: empty for a test with none.
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
What the test caused, as a tree: each request and what the service
did for it, then each delivery, with statuses and how long each
took. Under it, the calls between services that lost the test
(lost_context). What a failed test prints.
Trait Implementations§
Source§impl Serialize for Telemetry
impl Serialize for Telemetry
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Forget for Telemetry
impl Freeze for Telemetry
impl Move for Telemetry
impl RefUnwindSafe for Telemetry
impl Send for Telemetry
impl Sync for Telemetry
impl Unpin for Telemetry
impl UnsafeUnpin for Telemetry
impl UnwindSafe for Telemetry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request