semvec/pypi-packages huggingface dataset:
llama-index-observability-otel 0.4.1
llama-index observability integration with OpenTelemetry
Requires Python: <4.0,>=3.9

# LlamaIndex OpenTelemetry Observability Integration

## Installation

```shell
pip install llama-index-observability-otel
```

## Usage

You can use the default OpenTelemetry observability class as follows:

```python
from llama_index.observability.otel import LlamaIndexOpenTelemetry
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
from llama_index.core.llms import MockLLM
from llama_index.core.embeddings import MockEmbedding
from llama_index.core import Settings

# initialize the instrumentation object
instrumentor = LlamaIndexOpenTelemetry()

if __name__ == "__main__":
    embed_model = MockEmbedding(embed_dim=256)
    llm = MockLLM()
    Settings.embed_model = embed_model
    # start listening!
    instrumentor.start_registering()
    # register events
    documents = SimpleDirectoryReader(
        input_dir="./data/paul_graham/"
    ).load_data()
    index = VectorStoreIndex.from_documents(documents)
    query_engine = index.as_query_engine(llm=llm)
    query_result = query_engine.query("Who is Paul?")
    query_result_one = query_engine.query("What did Paul do?")
```

Or you can add some customization to the `LlamaIndexOpenTelemetry` class by, for example, set a custom span exporter, a custom service name, activating the debugging, set a custom list of extra span processors...

```python
from llama_index.observability.otel import LlamaIndexOpenTelemetry
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
from opentelemetry.exporter.otlp.proto.http.trace_exporter import (
    OTLPSpanExporter,
)
from opentelemetry.sdk.trace import SpanProcessor
from llama_index.core.llms import MockLLM
from llama_index.core.embeddings import MockEmbedding
from llama_index.core import Settings


class CustomSpanProcessor(SpanProcessor):
    # your implementation
    ...


# define a custom span exporter
span_exporter = OTLPSpanExporter("http://0.0.0.0:4318/v1/traces")

# initialize the instrumentation object
instrumentor = LlamaIndexOpenTelemetry(
    service_name_or_resource="my.test.service.1",
    span_exporter=span_exporter,
    debug=True,
    extra_span_processors=[CustomSpanProcessor()],
)

if __name__ == "__main__":
    embed_model = MockEmbedding(embed_dim=256)
    llm = MockLLM()
    Settings.embed_model = embed_model
    # start listening!
    instrumentor.start_registering()
    # register events
    documents = SimpleDirectoryReader(
        input_dir="./data/paul_graham/"
    ).load_data()
    index = VectorStoreIndex.from_documents(documents)
    query_engine = index.as_query_engine(llm=llm)
    query_result = query_engine.query("Who is Paul?")
    query_result_one = query_engine.query("What did Paul do?")
```
microperf 1.0.2
A small tool using perf to provide more performance insights.
Requires Python: >=3.9

# microperf

[![PyPI](https://img.shields.io/pypi/v/microperf.svg)](https://pypi.org/project/microperf/)
[![downloads](https://static.pepy.tech/badge/microperf)](https://pepy.tech/project/microperf)

`microperf` is a [`perf`](https://perfwiki.github.io) wrapper. The basic idea is
that it converts a `perf.data` file by inserting all samples into a database,
making it then easier to query for specific patterns or code smells.

## Usage

### Generating a profile

First, note that your executable should be compiled with debug symbols (`-g`,
`-DCMAKE_BUILD_TYPE=RelWithDebInfo`, ...).

Since `microperf` is simply a wrapper, generating a profile can be done directly
with `perf`.
```bash
perf record -F99 --call-graph=dwarf -- <COMMAND>
```

Alternatively, `microperf perf` provides a convenience passthrough to `perf`.
This can be useful when a different `perf` executable should be used (see
`MICROPERF_PERF_EXE` option below).

### Running the Patterns analyzer

I've written a couple queries to identify common bad patterns. At time of this
writing, this includes cycles spent in:
 1. tree-based structures (`std::map`, `std::set`): these can often be replaced
    with hash-based data structures.
 2. constructors: these are often signs of excessive copying.

## Options

The environment variable `MICROPERF_PERF_EXE` can be set to the path of a `perf`
executable to be used instead of the default `perf` command.
civicstream 1.1.1
CivicAlert Streaming Data Capture and Visualization Tool
Requires Python: >=3.8

CivicStream
===========

This package provides a command-line tool for capturing and visualizing streaming data
from a CivicAlert sensor device. It can be accessed from a command terminal by entering:

``civicstream``

Enter ``civicstream -h`` to see a listing of available command line parameters, including
activation of an IMU visualizer or configuration of the number of incoming audio channels.