Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix summary API endpoint returning truncated JSON #3407

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hingev
Copy link

@hingev hingev commented Jan 24, 2024

Upon startup, until hashrate statistics for all intervals were available, the http response for the summary endpoint would be corrupted.

"hashrate": {
  "total": [12930.96, null, null],
  "highest": 12968.11,
  "threads": [
      [671.19, %  

This was previously mentioned in #290 and #3363
With this fix, it should instead return

"hashrate": {
    "total": [743.79, null, null],
    "highest": 744.94,
    "threads": [
        [743.79, null, null],
        [723.8, null, null],
        [669.71, null, null],
        [720.22, null, null],
        [652.88, null, null],
        [740.84, null, null],
        [741.47, null, null],
        [725.48, null, null],
        [722.22, null, null],
        [741.58, null, null],
        [721.69, null, null],
        [740.42, null, null],
        [723.69, null, null],
        [740.0, null, null],
        [652.56, null, null],
        [670.66, null, null],
        [720.43, null, null],
        [744.73, null, null]
    ]
}

Upon startup, until statistics for all intervals were available, the
http response for the `summary` endpoint would be corrupted.
@xmrig
Copy link
Owner

xmrig commented Feb 21, 2024

I unable to reproduce this, also hashrate values handled by Json::normalize https://github.com/xmrig/xmrig/blob/master/src/base/io/json/Json.cpp#L210 so the extra call of std::isnormal should change nothing. If there is a bug it is located somewhere else.
Thank you.

@RobQuistNL
Copy link

This is happening for me too (6.21.2), on 2 different machines. See output here:

{
    "id": "2a71d747672e9862",
    "worker_id": "aorus",
    "uptime": 10,
    "restricted": true,
    "resources": {
        "memory": {
            "free": 111335350272,
            "total": 134157017088,
            "resident_set_memory": 9293824
        },
        "load_average": [5.16, 1.18, 0.46],
        "hardware_concurrency": 32
    },
    "features": ["api", "asm", "http", "hwloc", "tls"],
    "results": {
        "diff_current": 50000,
        "shares_good": 1,
        "shares_total": 1,
        "avg_time": 10,
        "avg_time_ms": 10622,
        "hashes_total": 50000,
        "best": [1046478, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        "error_log": []
    },
    "algo": "rx/0",
    "connection": {
        "pool": "pool.supportxmr.com:3333",
        "ip": "141.94.96.71",
        "uptime": 10,
        "uptime_ms": 10622,
        "ping": 40,
        "failures": 0,
        "tls": null,
        "tls-fingerprint": null,
        "algo": "rx/0",
        "diff": 50000,
        "accepted": 1,
        "rejected": 0,
        "avg_time": 10,
        "avg_time_ms": 10622,
        "hashes_total": 50000,
        "error_log": []
    },
    "version": "6.21.2",
    "kind": "miner",
    "ua": "XMRig/6.21.2 (Linux x86_64) libuv/1.48.0 gcc/13.2.1",
    "cpu": {
        "brand": "AMD Ryzen 9 7950X 16-Core Processor",
        "family": 25,
        "model": 97,
        "stepping": 2,
        "proc_info": 10882834,
        "aes": true,
        "avx2": true,
        "x64": true,
        "64_bit": true,
        "l2": 16777216,
        "l3": 67108864,
        "cores": 16,
        "threads": 32,
        "packages": 1,
        "nodes": 1,
        "backend": "hwloc/2.10.0",
        "msr": "ryzen_19h_zen4",
        "assembly": "ryzen",
        "arch": "x86_64",
        "flags": ["aes", "vaes", "avx", "avx2", "avx512f", "bmi2", "osxsave", "pdpe1gb", "sse2", "ssse3", "sse4.1", "popcnt", "cat_l3"]
    },
    "donate_level": 1,
    "paused": false,
    "algorithms": ["cn/1", "cn/2", "cn/r", "cn/fast", "cn/half", "cn/xao", "cn/rto", "cn/rwz", "cn/zls", "cn/double", "cn/ccx", "cn-lite/1", "cn-heavy/0", "cn-heavy/tube", "cn-heavy/xhv", "cn-pico", "cn-pico/tlo", "cn/upx2", "rx/0", "rx/wow", "rx/arq", "rx/graft", "rx/sfx", "rx/keva", "argon2/chukwa", "argon2/chukwav2", "argon2/ninja", "ghostrider"],
    "hashrate": {
        "total": [null, null, null],
        "highest": null,
        "threads": [
            [
{
    "id": "592e1a54621dcbf3",
    "worker_id": "ubuntu-desktop",
    "uptime": 179,
    "restricted": true,
    "resources": {
        "memory": {
            "free": 92244426752,
            "total": 134977318912,
            "resident_set_memory": 8257536
        },
        "load_average": [30.06, 17.91, 9.3],
        "hardware_concurrency": 24
    },
    "features": ["api", "asm", "http", "hwloc", "tls"],
    "results": {
        "diff_current": 488009,
        "shares_good": 8,
        "shares_total": 8,
        "avg_time": 22,
        "avg_time_ms": 22440,
        "hashes_total": 2418380,
        "best": [37554281, 2780415, 1877196, 899408, 499904, 154811, 138667, 53394, 0, 0],
        "error_log": []
    },
    "algo": "rx/0",
    "connection": {
        "pool": "pool.supportxmr.com:3333",
        "ip": "141.94.96.71",
        "uptime": 179,
        "uptime_ms": 179521,
        "ping": 41,
        "failures": 0,
        "tls": null,
        "tls-fingerprint": null,
        "algo": "rx/0",
        "diff": 488009,
        "accepted": 8,
        "rejected": 0,
        "avg_time": 22,
        "avg_time_ms": 22440,
        "hashes_total": 2418380,
        "error_log": []
    },
    "version": "6.21.2",
    "kind": "miner",
    "ua": "XMRig/6.21.2 (Linux x86_64) libuv/1.48.0 gcc/13.2.1",
    "cpu": {
        "brand": "AMD Ryzen 9 5900X 12-Core Processor",
        "family": 25,
        "model": 33,
        "stepping": 0,
        "proc_info": 10620688,
        "aes": true,
        "avx2": true,
        "x64": true,
        "64_bit": true,
        "l2": 6291456,
        "l3": 67108864,
        "cores": 12,
        "threads": 24,
        "packages": 1,
        "nodes": 1,
        "backend": "hwloc/2.10.0",
        "msr": "ryzen_19h",
        "assembly": "ryzen",
        "arch": "x86_64",
        "flags": ["aes", "vaes", "avx", "avx2", "bmi2", "osxsave", "pdpe1gb", "sse2", "ssse3", "sse4.1", "popcnt", "cat_l3"]
    },
    "donate_level": 1,
    "paused": false,
    "algorithms": ["cn/1", "cn/2", "cn/r", "cn/fast", "cn/half", "cn/xao", "cn/rto", "cn/rwz", "cn/zls", "cn/double", "cn/ccx", "cn-lite/1", "cn-heavy/0", "cn-heavy/tube", "cn-heavy/xhv", "cn-pico", "cn-pico/tlo", "cn/upx2", "rx/0", "rx/wow", "rx/arq", "rx/graft", "rx/sfx", "rx/keva", "argon2/chukwa", "argon2/chukwav2", "argon2/ninja", "ghostrider"],
    "hashrate": {
        "total": [10107.58, 10262.36, null],
        "highest": 10893.08,
        "threads": [
            [415.6, 430.39, 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants