Skip to main content

A lightweight Python performance tracking library with automatic data collection and visualization

Project description

Kode Kronical

High-performance Python library for automated performance monitoring and system metrics collection.

Overview

Kode Kronical provides automated performance monitoring for Python applications with:

  • Function Performance Tracking: Automatic timing and profiling of Python functions
  • System Metrics Collection: Real-time CPU, memory, and process monitoring
  • Enhanced Exception Handling: Detailed error context with system correlation
  • AWS Integration: Automatic DynamoDB uploads with 30-day TTL
  • Web Dashboard: Comprehensive visualization via kode-kronical-viewer
  • Zero Configuration: Works out-of-the-box with sensible defaults

Installation

pip install kode-kronical

Quick Start

1. Basic Usage

from kode_kronical import KodeKronical
import time

# Initialize the performance tracker
kode = KodeKronical()

# Use as decorator
@kode.time_it
def slow_function(n):
    time.sleep(0.1)
    return sum(range(n))

@kode.time_it(store_args=True)
def process_data(data, multiplier=2):
    return [x * multiplier for x in data]

# Call your functions - performance data is automatically collected
result1 = slow_function(1000)
result2 = process_data([1, 2, 3, 4, 5])

2. Configuration (Optional)

Create a .kode-kronical.yaml file in your project directory:

kode_kronical:
  enabled: true
  min_execution_time: 0.001

local:
  enabled: true
  data_dir: "./perf_data"

filters:
  exclude_modules:
    - "requests"
    - "boto3"

3. View Results

Automatic Data Collection:

  • Local Mode: Performance data saved to ./perf_data/ as JSON files
  • AWS Mode: Data uploaded to DynamoDB on program exit

Web Dashboard: Use the kode-kronical-viewer for visualization:

  • Performance overview and metrics
  • Function-by-function analysis
  • Historical trends and comparisons
  • System correlation analysis

Key Features

Enhanced Exception Handling

Kode Kronical captures detailed error context including system state when exceptions occur. See Exception Handling Guide for examples and configuration.

System Monitoring Daemon

Background daemon for continuous system monitoring that correlates with application performance. See Daemon Guide for complete setup and troubleshooting.

AWS Integration

Automatic upload to DynamoDB with optimized schema:

  • 1-minute data intervals for production efficiency
  • 30-day TTL for automatic cleanup
  • Real-time dashboard updates

API Summary

from kode_kronical import KodeKronical

kode = KodeKronical()

# Decorator usage
@kode.time_it                           # Basic timing
@kode.time_it(store_args=True)         # Store function arguments
@kode.time_it(tags=["critical"])       # Add custom tags

# Programmatic access
summary = kode.get_summary()            # Get performance summary
results = kode.get_timing_results()     # Get detailed results
config = kode.get_config_info()         # Get configuration info

REST API

When using with kode-kronical-viewer, these endpoints are available:

  • GET /api/performance/ - Performance data with filtering
  • GET /api/hostnames/ - Available hostnames
  • GET /api/functions/ - Function analysis data

Documentation

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: pytest tests/
  5. Submit a pull request

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kode_kronical-0.4.12.tar.gz (56.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kode_kronical-0.4.12-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

Details for the file kode_kronical-0.4.12.tar.gz.

File metadata

  • Download URL: kode_kronical-0.4.12.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for kode_kronical-0.4.12.tar.gz
Algorithm Hash digest
SHA256 7a68f0cee2bc34ed5d215f16a6535a92f4e3f86dc8a89ef284f52e1cc69a8091
MD5 c8606439c1277be1343ff7f7c5301da4
BLAKE2b-256 57c2037a3b335a51e5ab2ee3bfe4bd312d0f353f6fe93a550a87f026c2dc8839

See more details on using hashes here.

File details

Details for the file kode_kronical-0.4.12-py3-none-any.whl.

File metadata

  • Download URL: kode_kronical-0.4.12-py3-none-any.whl
  • Upload date:
  • Size: 59.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for kode_kronical-0.4.12-py3-none-any.whl
Algorithm Hash digest
SHA256 5d1b9132e2415a17ba5d3740aae5fe660847be2a0329fc1ffaf0c324805c5e63
MD5 d59e290764e86cc792567daa60da6e22
BLAKE2b-256 b385867c1424b2763a8fef7575aaf08bb3854873919f7edf1f3488b94a7e3ed5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page