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

Introduce Endpoint#seconds_{reading_messages,awaiting_semaphore,processing_messages} #10266

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

@Al2Klimov Al2Klimov self-assigned this Dec 10, 2024
@cla-bot cla-bot bot added the cla/signed label Dec 10, 2024
@Al2Klimov Al2Klimov changed the title Introduce Benchmark* Introduce Benchmark Dec 10, 2024
@Al2Klimov Al2Klimov force-pushed the json-rpc-read-process-metrics branch 2 times, most recently from 5d1b07f to 92a4f45 Compare December 10, 2024 14:50
@Al2Klimov Al2Klimov changed the title Introduce Benchmark Benchmark message reading/processing time per endpoint Dec 10, 2024
@Al2Klimov Al2Klimov force-pushed the json-rpc-read-process-metrics branch from ef2a7d3 to 3ebbfc6 Compare December 10, 2024 15:34

[no_user_modify, no_storage] double seconds_processing_messages {
get;
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works! 👍

< HTTP/1.1 200 OK
< Server: Icinga/v2.14.0-375-gecea52568
< Content-Type: application/json
< Content-Length: 591
<
{
    "results": [
        {
            "attrs": {
                "seconds_processing_messages": 3.1292e-05,
                "seconds_reading_messages": 0.000155709
            },
            "joins": {},
            "meta": {},
            "name": "dummy",
            "type": "Endpoint"
        },
        {
            "attrs": {
                "seconds_processing_messages": 0,
                "seconds_reading_messages": 0
            },
            "joins": {},
            "meta": {},
            "name": "ws-aklimov7777777.local",
            "type": "Endpoint"
        }
    ]
}

@Al2Klimov Al2Klimov force-pushed the json-rpc-read-process-metrics branch from 3ebbfc6 to f845407 Compare December 10, 2024 16:01
Copy link
Member Author

@Al2Klimov Al2Klimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also works! 👍

new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond)
new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond),
new PerfdataValue("sum_seconds_reading_messages", secondsReadingMessages),
new PerfdataValue("sum_seconds_processing_messages", secondsProcessingMessages)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                        {
                            "counter": false,
                            "crit": null,
                            "label": "sum_seconds_reading_messages",
                            "max": null,
                            "min": null,
                            "type": "PerfdataValue",
                            "unit": "",
                            "value": 0.000787875,
                            "warn": null
                        },
                        {
                            "counter": false,
                            "crit": null,
                            "label": "sum_seconds_processing_messages",
                            "max": null,
                            "min": null,
                            "type": "PerfdataValue",
                            "unit": "",
                            "value": 3.45e-05,
                            "warn": null
                        }

@@ -148,6 +152,8 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckRes
perfdata->Add(new PerfdataValue("sum_messages_received_per_second", messagesReceivedPerSecond));
perfdata->Add(new PerfdataValue("sum_bytes_sent_per_second", bytesSentPerSecond));
perfdata->Add(new PerfdataValue("sum_bytes_received_per_second", bytesReceivedPerSecond));
perfdata->Add(new PerfdataValue("sum_seconds_reading_messages", secondsReadingMessages));
perfdata->Add(new PerfdataValue("sum_seconds_processing_messages", secondsProcessingMessages));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                        {
                            "counter": false,
                            "crit": null,
                            "label": "sum_seconds_reading_messages",
                            "max": null,
                            "min": null,
                            "type": "PerfdataValue",
                            "unit": "",
                            "value": 0.000264792,
                            "warn": null
                        },
                        {
                            "counter": false,
                            "crit": null,
                            "label": "sum_seconds_processing_messages",
                            "max": null,
                            "min": null,
                            "type": "PerfdataValue",
                            "unit": "",
                            "value": 5.2666e-05,
                            "warn": null
                        }

@Al2Klimov Al2Klimov removed their assignment Dec 10, 2024
@Al2Klimov Al2Klimov marked this pull request as ready for review December 10, 2024 16:02
@Al2Klimov Al2Klimov added enhancement New feature or request area/distributed Distributed monitoring (master, satellites, clients) area/api REST API area/checks Check execution and results labels Dec 10, 2024
get;
};

[no_user_modify, no_storage] double seconds_processing_messages {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colleagues, addition we could also (just for the API) record seconds_processing_messages PER message. I.e. there should be also another attribute returning a dict like {"event::CheckResult":42.0,... saying that this endpoint e.g. spent 42 seconds handling (already read and decoded) event::CheckResult messages since program start.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Al2Klimov Al2Klimov force-pushed the json-rpc-read-process-metrics branch from f845407 to 20460e6 Compare December 11, 2024 09:39
@Al2Klimov Al2Klimov force-pushed the json-rpc-read-process-metrics branch from 20460e6 to 055c6b6 Compare December 11, 2024 09:41
@Al2Klimov Al2Klimov changed the title Benchmark message reading/processing time per endpoint Introduce Endpoint#seconds_{reading_messages,awaiting_semaphore,processing_messages} Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API area/checks Check execution and results area/distributed Distributed monitoring (master, satellites, clients) cla/signed enhancement New feature or request ref/NC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant