archivist_lib::logs::container

Struct LogsArtifactsContainer

Source
pub struct LogsArtifactsContainer {
    pub identity: Arc<ComponentIdentity>,
    pub stats: Arc<LogStreamStats>,
    /* private fields */
}

Fields§

§identity: Arc<ComponentIdentity>

The source of logs in this container.

§stats: Arc<LogStreamStats>

Inspect instrumentation.

Implementations§

Source§

impl LogsArtifactsContainer

Source

pub fn new<'a>( identity: Arc<ComponentIdentity>, interest_selectors: impl Iterator<Item = &'a LogInterestSelector>, initial_interest: Option<FidlSeverity>, stats: Arc<LogStreamStats>, buffer: ContainerBuffer, on_inactive: Option<OnInactive>, ) -> Self

Source

pub fn cursor_raw(&self, mode: StreamMode) -> PinStream<CursorItem>

Returns a stream of this component’s log messages. These are the raw messages in FXT format.

§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.

Source

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.

Source

pub fn handle_log_sink( self: &Arc<Self>, stream: LogSinkRequestStream, scope: ScopeHandle, )

Handle LogSink protocol on stream. Each socket received from the LogSink client is drained by a Task which is sent on sender. The Tasks do not complete until their sockets have been closed.

Source

pub async fn drain_messages<E>(self: Arc<Self>, log_stream: LogMessageSocket<E>)
where E: Encoding + Unpin,

Drain a LogMessageSocket which wraps a socket from a component generating logs.

Source

pub fn ingest_message(&self, message: StoredMessage)

Updates log stats in inspect and push the message onto the container’s buffer.

Source

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.

Source

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.

Source

pub fn is_active(&self) -> bool

Returns true if this container corresponds to a running component, or still has pending objects to drain.

Source

pub fn terminate(&self)

Stop accepting new messages, ensuring that pending Cursors return Poll::Ready(None) after consuming any messages received before this call.

Trait Implementations§

Source§

impl Debug for LogsArtifactsContainer

Source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Cast the given object into a dyn std::any::Any.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more