{"id":15086175,"url":"https://github.com/extraorange/robotframework-stopwatch","last_synced_at":"2026-01-03T06:45:50.440Z","repository":{"id":256983015,"uuid":"857006770","full_name":"extraorange/robotframework-stopwatch","owner":"extraorange","description":"Evaluate test case execution against average time \u0026 delta.","archived":false,"fork":false,"pushed_at":"2024-10-02T17:34:45.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T12:09:09.918Z","etag":null,"topics":["automation","performance","robotframework","robotframework-listener"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/robotframework-stopwatch/0.2.1/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/extraorange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-09-13T16:14:05.000Z","updated_at":"2024-10-02T17:34:51.000Z","dependencies_parsed_at":"2024-09-14T07:11:37.827Z","dependency_job_id":"60983e62-c27b-45be-b745-72b9fd805eb1","html_url":"https://github.com/extraorange/robotframework-stopwatch","commit_stats":null,"previous_names":["extraorange/robotframework-stopwatch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extraorange%2Frobotframework-stopwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extraorange%2Frobotframework-stopwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extraorange%2Frobotframework-stopwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extraorange%2Frobotframework-stopwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extraorange","download_url":"https://codeload.github.com/extraorange/robotframework-stopwatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960666,"owners_count":20375105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["automation","performance","robotframework","robotframework-listener"],"created_at":"2024-09-25T07:32:44.547Z","updated_at":"2026-01-03T06:45:50.395Z","avatar_url":"https://github.com/extraorange.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# robotframework-stopwatch\n![Version](https://img.shields.io/badge/version-0.2.10-%2392C444)\n\nRobot Framework listener extension for agile perfomance testing.\n\nEvaluate test case execution against its statistical average run time \u0026 user-configured timedelta in.\n\n## Why?\nWhile Robot Framework does provide an ability to setup time limits (e.g. timeouts) as a means of failing tests/suites depending on their time of execution, such approach is somewhat set in stone. Meaning that you have to manually inspect runtimes of your tests and decide upon much needed time limits. When you have single master suite, or your testing production is not quite large - this works alright. But when your number of tests is 300+, managing each timeout individually is rather straining. Add to that multiple layers of configurations such as different environments, testing tools, or downright infrastructure inconsistencies that do occur and you end up quite strained with the idea of reliable perfomance testing. **This extension is an attempt to provide a reliable tool for flexible, integrated perfomance testing.**\n\n## Overview\nAs mentioned above, *robotframework-stopwatch is not quite a library, but extension of built-in Robot Framework Listener.*\n\nWhen first integrated, the ``StopwatchListener`` will initialise an empty logfile (by default: ``./stopwatch_log.json``) to store required run data for every individual test. After first run, taking into consideration the test succeeded, average runtime for this test will be set to this run time of execution. Afterwards, each succesful test runtime will be used to update the last average runtime value for the test. The user-preconfigured ``timedelta`` is then used to evaluate all future test runs status. Failed tests, whether due to timedelta exceeded or natural test fails, have no effect upon test average runtime. Extension also provides a log data divider ``environment`` to catalog same tests based on different setups.\n\nWhen test with established average runtime fails due to exceeded time limit, test is marked as failed with a following message output:\n\n```\nStopwatch! Test runtime exceeded the acceptable time limit.\n```\n\n## Installation\n\n```shell\npip install robotframework-stopwatch\n```\n\n## Usage\n**robotframework-stopwatch** relies on a single base class ``StopwatchListener``, that comes with following attributes:\n\n- ``logfile (str)``: The path to the log file. By default: ``./stopwatch_log.json``\n\n- ``environment (str, optional)`` The marker/divider used to separate test run data across different configurations.\n\n- ``timedelta (str, optional)``: The time delta value used for evaluating test runtimes.\n            Defaults to ``\"10s\"``. Time formats include: ``\"5s\"``, ``\"2 min\"``, ``\"1 hour\"``.\n\nThere are two ways to implement robotframework-stopwatch.\n\n#### Listener approach\nWhen custom listener is already in-use, *or robotframework-stopwatch is needed on a global level* (every suite, every test), create or modify the listener:\n\n```python\nfrom robot.stopwatch import StopwatchListener\n\nclass CustomListener(StopwatchListener):\n    def __init__(self, logfile, environment, timedelta):\n```\n\nThis won't interfere with your custon listener functionality.\n\n#### Command-line approach\nWhen there is a need to set separate timedelta for different suites/tests, or setting up a listener is not required, it is possible to pass ``StopwatchListener`` and its command line arguments directly from terminal:\n\n```shell\nrobot --listener robot.stopwatch.StopwatchListener:\"logfile\":\"environment\":\"timedelta\" some_test.robot\n```\n### Concurecy\n\nAs of now, robotframework-stopwatch supports concurent read/write, making it possible to share a logfile data among multiple agents, instances, test runners. To incorporate concurent logging do rely on the most suitable tactics of shared file storage for your organisation (e.g. Azure Shared Storage).\n\n## Plans\n1. Interface for setting up test run data log in a remote database. \n2. Robust ``timedelta`` time formats.\n3. Robust ``logfile`` handling.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextraorange%2Frobotframework-stopwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextraorange%2Frobotframework-stopwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextraorange%2Frobotframework-stopwatch/lists"}