Struct archivist_lib::logs::container::LogsArtifactsContainer
source · pub struct LogsArtifactsContainer {
pub identity: Arc<ComponentIdentity>,
pub stats: Arc<LogStreamStats>,
pub event_timestamp: Time,
/* private fields */
}
Fields§
§identity: Arc<ComponentIdentity>
The source of logs in this container.
stats: Arc<LogStreamStats>
Inspect instrumentation.
event_timestamp: Time
The time when the container was created by the logging framework.
Implementations§
source§impl LogsArtifactsContainer
impl LogsArtifactsContainer
pub fn new<'a>( identity: Arc<ComponentIdentity>, interest_selectors: impl Iterator<Item = &'a LogInterestSelector>, parent_node: &Node, budget: BudgetHandle ) -> Self
sourcepub fn cursor(
&self,
mode: StreamMode,
parent_trace_id: Id
) -> PinStream<Arc<LogsData>>
pub fn cursor( &self, mode: StreamMode, parent_trace_id: Id ) -> PinStream<Arc<LogsData>>
Returns a stream of this component’s log messages.
§Rolled out logs
When messages are evicted from our internal buffers before a client can read them, they are counted as rolled out messages which gets appended to the metadata of the next message. If there is no next message, there is no way to know how many messages were rolled out.
sourcepub fn handle_log_sink(
self: &Arc<Self>,
stream: LogSinkRequestStream,
sender: UnboundedSender<Task<()>>
)
pub fn handle_log_sink( self: &Arc<Self>, stream: LogSinkRequestStream, sender: UnboundedSender<Task<()>> )
Handle LogSink
protocol on stream
. Each socket received from the LogSink
client is
drained by a Task
which is sent on sender
. The Task
s do not complete until their
sockets have been closed.
sourcepub async fn drain_messages<E>(self: Arc<Self>, log_stream: LogMessageSocket<E>)
pub async fn drain_messages<E>(self: Arc<Self>, log_stream: LogMessageSocket<E>)
Drain a LogMessageSocket
which wraps a socket from a component
generating logs.
sourcepub fn ingest_message(&self, message: GenericStoredMessage)
pub fn ingest_message(&self, message: GenericStoredMessage)
Updates log stats in inspect and push the message onto the container’s buffer.
sourcepub fn update_interest<'a>(
&self,
interest_selectors: impl Iterator<Item = &'a LogInterestSelector>,
previous_selectors: &[LogInterestSelector]
)
pub fn update_interest<'a>( &self, interest_selectors: impl Iterator<Item = &'a LogInterestSelector>, previous_selectors: &[LogInterestSelector] )
Set the Interest
for this component, notifying all active LogSink/WaitForInterestChange
hanging gets with the new interset if it is a change from the previous interest.
For any match that is also contained in previous_selectors
, the previous values will be
removed from the set of interests.
sourcepub fn reset_interest(&self, interest_selectors: &[LogInterestSelector])
pub fn reset_interest(&self, interest_selectors: &[LogInterestSelector])
Resets the Interest
for this component, notifying all active
LogSink/WaitForInterestChange
hanging gets with the lowest interest found in the set of
requested interests for all control handles.
sourcepub fn pop(&self) -> Option<Arc<GenericStoredMessage>>
pub fn pop(&self) -> Option<Arc<GenericStoredMessage>>
Remove the oldest message from this buffer, returning it.
sourcepub fn should_retain(&self) -> bool
pub fn should_retain(&self) -> bool
Returns true
if this container corresponds to a running component, still has log messages
or still has pending objects to drain.
sourcepub fn oldest_timestamp(&self) -> Option<i64>
pub fn oldest_timestamp(&self) -> Option<i64>
Returns the timestamp of the earliest log message in this container’s buffer, if any.