Citibox profiling tool
Project description
Citibox profiling
Python library to profiling inside Citibox backend team
How to use it?
Install via pip and initialize it as soon as possible with the following code:
from citibox.profiling import Profiling, GoogleConfig, ProfilerServiceGoogle
profiling_config = GoogleConfig(
service_name="name_of_your_service",
service_version="core-001",
project_id="gcp_project_id",
service_account_json_file="path/to/json_credentials-json",
)
profiling_service = ProfilerServiceGoogle(profiling_config)
profiling = Profiling(profiler_service=profiling_service)
profiling.start()
##Step-by-step guide:
- Import library profiler, config and service implementation:
from citibox.profiling import Profiling, GoogleConfig, ProfilerServiceGoogle
- Create config for your service
profiling_config = GoogleConfig(
service_name="name_of_your_service",
service_version="core-001",
project_id="gcp_proyect_id",
service_account_json_file="path/to/json_credentials-json",
)
- Create the service with the previous configuration and pass it to profiling
profiling_service = ProfilerServiceGoogle(profiling_config)
profiling = Profiling(profiler_service=profiling_service)
- Start collecting information
profiling.start()
- Enjoy it
How to use in django project?
Define config in settings
PROFILING = {
'ACTIVE': True,
'SERVICE_NAME': 'app_service',
'SERVICE_VERSION': 'core-001',
'PROJECT_ID': 'gcp_project_id',
'SERVICE_ACCOUNT_JSON_FILE': 'path/to/json_credentials-json',
}
Add middleware in config
MIDDLEWARE = [
'citibox.profiling.contrib.django.ProfilingMiddleware',
]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for citibox_profiling-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98cb61f4af70bceeba1f2f04d0246f0a34edd65243941a45bb7cef3424a0ad93 |
|
MD5 | caa714eae2713817f3e8d8a93fad2646 |
|
BLAKE2b-256 | 33ff1f2d7347cec925c8928195d4d42c7f89efc55699dd4d277d9181f9f9b8b2 |