### Docker Deployment for EHentai Metrics Source: https://context7.com/mixa3607/eh_metrics/llms.txt Deploys the EHentai Metrics Collector as a standalone Docker container. This includes pulling the image, creating a configuration file, running the container with volume mounts, and verifying the metrics endpoint. Ensure Docker is installed and running. ```bash # Pull the Docker image docker pull ghcr.io/mixa3607/eh_metrics:v1.3.0 # Create appsettings.json with your configuration cat > appsettings.json << 'EOF' { "EhClient": { "MemberId": "9965000", "PassHash": "bbc23afa07096d2f700b1d48c1ba777f", "SessionId": "5529515b6d7a892362de74e2b444c987" }, "AppQuartz": { "Jobs": { "hath_status_metrics": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */1 * ? * *", "JobType": "CollectHathStatusMetricsJob" } } } } EOF # Run the container docker run -d \ --name eh-metrics \ -p 8080:8080 \ -v $(pwd)/appsettings.json:/homes/app/appsettings.Production.json:ro \ -e ASPNETCORE_ENVIRONMENT=Production \ --restart unless-stopped \ ghcr.io/mixa3607/eh_metrics:v1.3.0 # Verify metrics endpoint curl http://localhost:8080/metrics ``` -------------------------------- ### Register CollectHomeOverviewMetricsJob in appsettings.json Source: https://context7.com/mixa3607/eh_metrics/llms.txt Configuration for the CollectHomeOverviewMetricsJob, used to collect EHTracker torrent statistics and Gallery Points. The snippet includes job registration and examples of various Prometheus metrics related to torrents and GP. ```json { "home_overview_metrics": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */10 * ? * *", // Every 10 minutes "JobType": "CollectHomeOverviewMetricsJob" } } // Exposed Prometheus metrics: // eh_eht_uploaded_mb{user="9965000"} 50000 // eh_eht_downloaded_mb{user="9965000"} 25000 // eh_eht_seed_minutes{user="9965000"} 120000 // eh_eht_completes_number{type="gallery",user="9965000"} 150 // eh_eht_completes_number{type="torrent",user="9965000"} 75 // eh_eht_up_down_ratio{user="9965000"} 2.0 // eh_gp_gained_number{type="gallery_visits",user="9965000"} 5000 // eh_gp_gained_number{type="torrent_completions",user="9965000"} 3000 // eh_gp_gained_number{type="archive_downloads",user="9965000"} 1500 // eh_gp_gained_number{type="hath",user="9965000"} 10000 ``` -------------------------------- ### Register CollectHathPerksMetricsJob in appsettings.json Source: https://context7.com/mixa3607/eh_metrics/llms.txt Configuration for the CollectHathPerksMetricsJob, which monitors the current Hath balance. This snippet shows the job registration in appsettings.json and an example Prometheus metric for the Hath balance. ```json { "hath_perks_metrics": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */10 * ? * *", // Every 10 minutes "JobType": "CollectHathPerksMetricsJob" } } // Exposed Prometheus metrics: // eh_hath_balance_number{user="9965000"} 125000 ``` -------------------------------- ### Docker Compose Deployment for EHentai Metrics Stack Source: https://context7.com/mixa3607/eh_metrics/llms.txt Sets up a multi-service deployment using Docker Compose, including the EHentai Metrics Collector, Prometheus for scraping metrics, and Grafana for visualization. This requires `docker-compose.yml` and `prometheus.yml` files to be present. The services are started with `docker-compose up -d`. ```yaml # docker-compose.yml services: eh-metrics: image: ghcr.io/mixa3607/eh_metrics:v1.3.0 environment: - ASPNETCORE_ENVIRONMENT=Production volumes: - ./appsettings.json:/homes/app/appsettings.Production.json:ro ports: - 80:8080 restart: unless-stopped prometheus: image: prom/prometheus:latest volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - prometheus-data:/prometheus ports: - 9090:9090 restart: unless-stopped grafana: image: grafana/grafana:latest volumes: - grafana-data:/var/lib/grafana ports: - 3000:3000 restart: unless-stopped volumes: prometheus-data: grafana-data: ``` ```yaml # prometheus.yml global: scrape_interval: 15s scrape_configs: - job_name: 'eh-metrics' static_configs: - targets: ['eh-metrics:8080'] ``` ```bash # Deploy the stack docker-compose up -d # Access services # Metrics: http://localhost:80/metrics # Prometheus: http://localhost:9090 # Grafana: http://localhost:3000 ``` -------------------------------- ### Register CollectHathSettingsMetricsJob in appsettings.json Source: https://context7.com/mixa3607/eh_metrics/llms.txt Configuration for the CollectHathSettingsMetricsJob, which extracts H@H client configuration metrics. This snippet shows how to register the job in appsettings.json and lists example Prometheus metrics exposed by this job. ```json { "hath_settings_45044": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */10 * ? * *", // Every 10 minutes "JobType": "CollectHathSettingsMetricsJob", "JobData": { "ClientId": 45044 } } } // Exposed Prometheus metrics: // eh_hath_clients_ranges_groups_number{client_id="45044",client_name="primary",group_type="Priority1",user="9965000"} 10 // eh_hath_clients_ranges_groups_number{client_id="45044",client_name="primary",group_type="Priority2",user="9965000"} 5 // eh_hath_clients_ranges_groups_number{client_id="45044",client_name="primary",group_type="HighCapacity",user="9965000"} 3 ``` -------------------------------- ### Register CheckNewReleasesJob in appsettings.json Source: https://context7.com/mixa3607/eh_metrics/llms.txt Configuration for the CheckNewReleasesJob, which checks GitHub for new releases and updates version state. This snippet shows the job registration in appsettings.json, including an option to enable the beta channel, and an example Prometheus metric for app version state. ```json { "version_check": { "Enable": true, "TriggerOnStartup": true, "Group": "util", "CronExpression": "0 0 0/8 ? * * *", // Every 8 hours "JobType": "CheckNewReleasesJob", "JobData": { "EnableBetaChannel": false // Optional: include pre-releases } } } // Exposed Prometheus metrics: // eh_app_version_state{user="9965000"} 1 // Values: 0 = unknown, 1 = latest, 2 = outdated ``` -------------------------------- ### Register ClientDirectUserSpeedTestJob in appsettings.json Source: https://context7.com/mixa3607/eh_metrics/llms.txt Configuration for the ClientDirectUserSpeedTestJob, which performs direct speed tests to H@H client endpoints. This snippet includes the job registration in appsettings.json with parameters like ClientId, ClientKey, and SpeedTest settings, along with example Prometheus metrics. ```json { "speed_test_client_45044": { "Enable": true, "TriggerOnStartup": false, "Group": "tests", "CronExpression": "0 0 */6 ? * *", // Every 6 hours "JobType": "ClientDirectUserSpeedTestJob", "JobData": { "ClientId": 45044, "ClientKey": "d41d8cd98f00b204e9800998ecf8427e", "ClientHost": "https://127.0.0.1:443", "ClientName": "primary", "SizeBytes": 2097152, // 2MB per request "ThreadsCount": 3 // Parallel requests } } } // Exposed Prometheus metrics: // eh_hath_client_direct_speed_test_kbps{client_id="45044",client_name="primary",host="https://127.0.0.1:443",user="9965000"} 45000 // eh_hath_client_direct_speed_test_errors_number{client_id="45044",client_name="primary",host="https://127.0.0.1:443",user="9965000"} 0 ``` -------------------------------- ### EHentai CollectHathStatusMetricsJob Configuration and Metrics Source: https://context7.com/mixa3607/eh_metrics/llms.txt Demonstrates the configuration for the 'CollectHathStatusMetricsJob' in `appsettings.json` and lists the Prometheus metrics it exposes. This job collects H@H regional network statistics and client operational metrics. ```json // Job registration in appsettings.json { "hath_status_metrics": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */1 * ? * *", // Every minute "JobType": "CollectHathStatusMetricsJob" } } // Exposed Prometheus metrics: // eh_hath_regions_netload_mbps{region="Asia",user="9965000"} 123.45 // eh_hath_regions_hits_per_second_ratio{region="Europe",user="9965000"} 0.85 // eh_hath_regions_hits_per_gb_ratio{region="Americas",user="9965000"} 12.5 // eh_hath_regions_quality_number{region="Asia",user="9965000"} 950 // eh_hath_clients_files_served_number{client_name="primary",client_id="45044",user="9965000"} 125000 // eh_hath_clients_max_speed_kbps{client_name="primary",client_id="45044",user="9965000"} 50000 // eh_hath_clients_trust_number{client_name="primary",client_id="45044",user="9965000"} 1000 // eh_hath_clients_quality_number{client_name="primary",client_id="45044",user="9965000"} 950 // eh_hath_clients_hitrate_number{client_name="primary",client_id="45044",user="9965000"} 15 // eh_hath_clients_hathrate_number{client_name="primary",client_id="45044",user="9965000"} 250 // eh_hath_clients_status_enum{client_name="primary",client_id="45044",user="9965000"} 1 ``` -------------------------------- ### Query Prometheus Metrics Endpoint using curl Source: https://context7.com/mixa3607/eh_metrics/llms.txt Demonstrates how to query the Prometheus metrics endpoint and displays sample output. This is useful for verifying that metrics are being collected and exposed correctly by the various jobs in the project. ```bash # Query the metrics endpoint curl http://localhost:8080/metrics # Sample output: # TYPE eh_hath_balance_number gauge eh_hath_balance_number{user="9965000"} 125000 # TYPE eh_hath_regions_netload_mbps gauge eh_hath_regions_netload_mbps{region="Asia",user="9965000"} 123.45 eh_hath_regions_netload_mbps{region="Europe",user="9965000"} 98.75 # TYPE eh_hath_clients_files_served_number gauge eh_hath_clients_files_served_number{client_name="primary",client_id="45044",user="9965000"} 125000 # TYPE eh_job_run_time_seconds histogram eh_job_run_time_seconds_sum{name="eh.hath_status_metrics",user="9965000"} 45.23 eh_job_run_time_seconds_count{name="eh.hath_status_metrics",user="9965000"} 150 # TYPE eh_job_failures_number counter eh_job_failures_number{name="eh.hath_status_metrics",user="9965000"} 0 ``` -------------------------------- ### Configure Job Scheduling with AppQuartz Source: https://context7.com/mixa3607/eh_metrics/llms.txt Defines the schedule and configuration for various metric collection jobs using AppQuartz. This JSON structure allows enabling/disabling jobs, setting cron expressions for execution frequency, and specifying job types and parameters. ```json { "AppQuartz": { "Jobs": { "hath_status_metrics": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */1 * ? * *", "JobType": "CollectHathStatusMetricsJob" }, "hath_settings_metrics_45044": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */10 * ? * *", "JobType": "CollectHathSettingsMetricsJob", "JobData": { "ClientId": 45044 } }, "hath_perks_metrics": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */10 * ? * *", "JobType": "CollectHathPerksMetricsJob" }, "home_overview_metrics": { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */10 * ? * *", "JobType": "CollectHomeOverviewMetricsJob" }, "version_check": { "Enable": true, "TriggerOnStartup": true, "Group": "util", "CronExpression": "0 0 0/8 ? * * *", "JobType": "CheckNewReleasesJob" }, "speed_test_client_45044": { "Enable": true, "TriggerOnStartup": false, "Group": "tests", "CronExpression": "0 0 */6 ? * *", "JobType": "ClientDirectUserSpeedTestJob", "JobData": { "ClientId": 45044, "ClientKey": "d41d8cd98f00b204e9800998ecf8427e", "ClientHost": "https://127.0.0.1:443", "ClientName": "primary", "SizeBytes": 2097152, "ThreadsCount": 3 } } } } } ``` -------------------------------- ### Configure EHentai Client Authentication Source: https://context7.com/mixa3607/eh_metrics/llms.txt Sets up authentication details for the EHentai client, including Member ID, Pass Hash, Session ID, and optional proxy configuration. This is crucial for accessing restricted E-Hentai data. ```json { "EhClient": { "MemberId": "9965000", "PassHash": "bbc23afa07096d2f700b1d48c1ba777f", "SessionId": "5529515b6d7a892362de74e2b444c987", "Proxy": { "Address": "socks5://127.0.0.1:2080", "UserName": "myuser", "Password": "mypassword" } } } ``` -------------------------------- ### Collect Hath Settings Metrics Job Configuration Source: https://github.com/mixa3607/eh_metrics/blob/master/README.md This snippet details the configuration for the 'CollectHathSettingsMetricsJob'. It specifies the JobType and requires 'ClientId' in JobData. The site page for data retrieval, including the ClientId parameter, is also provided. ```text JobType: CollectHathSettingsMetricsJob JobData: ClientId* = H@H client id Site page: /hentaiathome.php?cid=&act=settings ``` -------------------------------- ### Configure EHentai Client Settings Source: https://github.com/mixa3607/eh_metrics/blob/master/README.md This JSON configuration defines the necessary client settings for interacting with EHentai. It includes essential cookies like MemberId, PassHash, and SessionId, and optionally supports proxy configuration for network requests. ```json { "MemberId": "9965000", "PassHash": "bbc23afa07096d2f700b1d48c1ba777f", "SessionId": "5529515b6d7a892362de74e2b444c987", // proxy is optional //"Proxy": { // "Address": "socks5://127.0.0.1:2080", // "UserName": "", // "Password": "", //} } ``` -------------------------------- ### Configure EHentai Job Settings Source: https://github.com/mixa3607/eh_metrics/blob/master/README.md This JSON configuration defines individual jobs for collecting EHentai metrics. It allows enabling/disabling jobs, setting their execution schedule using cron expressions, specifying the job type, and providing additional data required by specific job types. ```json hath_settings_metrics_45044: { "Enable": true, "TriggerOnStartup": true, "Group": "eh", "CronExpression": "0 */10 * ? * *", "JobType": "CollectHathSettingsMetricsJob", "JobData": { "ClientId": 45044 } } ``` -------------------------------- ### Collect Hath Status Metrics Job Configuration Source: https://github.com/mixa3607/eh_metrics/blob/master/README.md This snippet outlines the configuration for the 'CollectHathStatusMetricsJob'. It specifies the JobType and indicates that no additional JobData is required. The associated site page for data retrieval is also provided. ```text JobType: CollectHathStatusMetricsJob JobData: - Site page: /hentaiathome.php ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.