{"id":19959810,"url":"https://github.com/joaohf/pmclock","last_synced_at":"2026-06-09T19:31:50.277Z","repository":{"id":189522437,"uuid":"680668474","full_name":"joaohf/pmclock","owner":"joaohf","description":"Performance Monitoring Clock, G.7710","archived":false,"fork":false,"pushed_at":"2023-08-20T14:57:06.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T16:23:59.856Z","etag":null,"topics":["erlang","timers"],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joaohf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-20T02:15:47.000Z","updated_at":"2023-08-20T14:57:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"937f267e-0e8e-494d-9727-216658d9a222","html_url":"https://github.com/joaohf/pmclock","commit_stats":null,"previous_names":["joaohf/pmclock"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joaohf/pmclock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaohf%2Fpmclock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaohf%2Fpmclock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaohf%2Fpmclock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaohf%2Fpmclock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joaohf","download_url":"https://codeload.github.com/joaohf/pmclock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaohf%2Fpmclock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34123171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["erlang","timers"],"created_at":"2024-11-13T01:51:35.054Z","updated_at":"2026-06-09T19:31:50.253Z","avatar_url":"https://github.com/joaohf.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"pmclock\n=======\n\nThis repository implements some functions from the pmclock as described in [G.7710 : Common equipment management function requirements](https://www.itu.int/rec/T-REC-G.7710-202010-I/en).\n\n![pmclock functions](/pmclock_function.png)\n\nHow it works is described below, but the src/pmclock_statem.erl just implements the itens 3 and 4.\n\n![pmclock functions](/pmclock_process.png)\n\nThe pmclock_statem was design to receive registration from any process and sends pmclocks for 15-min and/or 24-hour to all registered process.\n\nA gen_statem has chosen for the implementation because it manages timeouts using [generic time-outs](https://www.erlang.org/doc/design_principles/statem#generic-time-outs) which is very handy. Rather than using [erlang:send_after/4](https://www.erlang.org/doc/man/erlang#send_after-4).\n\nBuild\n-----\n\n    $ rebar3 compile\n\nRun\n---\n\n```\nerl +c true +C multi_time_warp -pa _build/default/lib/pmclock/ebin/\n1\u003e pmclock_statem:start().\n\n=NOTICE REPORT==== 19-Aug-2023::22:52:45.779958 ===\n    info: #{time_correction =\u003e true,time_warp_mode =\u003e multi_time_warp,\n            os_system_time_source =\u003e\n                [{function,clock_gettime},\n                 {clock_id,'CLOCK_REALTIME'},\n                 {resolution,1000000000},\n                 {parallel,yes},\n                 {time,1692485565779934398}],\n            os_monotonic_time_source =\u003e\n                [{function,clock_gettime},\n                 {clock_id,'CLOCK_MONOTONIC'},\n                 {resolution,1000000000},\n                 {extended,no},\n                 {parallel,yes},\n                 {time,2466151075548}]}\n    msg: periods\n    '15m': {{timeout,'15m'},\n            -576460315844,\n            {pmclock,-576460315844,#{period =\u003e '15m',period_t =\u003e 900}},\n            [{abs,true}]}\n    '24h': {{timeout,'24h'},\n            -576456716623,\n            {pmclock,-576456716623,#{period =\u003e '24h',period_t =\u003e 86400}},\n            [{abs,true}]}\n    start_period_15m: -576460315844\n    start_period_24h: -576456716623\n{ok,\u003c0.88.0\u003e}\n```\n\nReferences\n----------\n\n* [Periodic sending a message based on clock wall time](https://erlangforums.com/t/periodic-sending-a-message-based-on-clock-wall-time/2800)\n\nTODO\n----\n\n- [ ] Add unit tests\n- [ ] Add support for configure pmclock's periods other than 15-min and 24-hour","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaohf%2Fpmclock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoaohf%2Fpmclock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaohf%2Fpmclock/lists"}