Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/datasette/datasette-uptime
Datasette plugin showing uptime at /-/uptime
https://github.com/datasette/datasette-uptime
Last synced: about 2 months ago
JSON representation
Datasette plugin showing uptime at /-/uptime
- Host: GitHub
- URL: https://github.com/datasette/datasette-uptime
- Owner: datasette
- License: apache-2.0
- Created: 2024-03-06T05:10:08.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-06T05:19:17.000Z (10 months ago)
- Last Synced: 2024-09-18T04:38:30.349Z (4 months ago)
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# datasette-uptime
[![PyPI](https://img.shields.io/pypi/v/datasette-uptime.svg)](https://pypi.org/project/datasette-uptime/)
[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-uptime?include_prereleases&label=changelog)](https://github.com/datasette/datasette-uptime/releases)
[![Tests](https://github.com/datasette/datasette-uptime/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-uptime/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-uptime/blob/main/LICENSE)Datasette plugin showing uptime at /-/uptime
## Installation
Install this plugin in the same environment as Datasette.
```bash
datasette install datasette-uptime
```
## UsageAdds an endpint at `/-/uptime` returning JSON that looks like this:
```json
{
"started": 355764.709263208,
"now": 355824.192608208,
"uptime_seconds": 59.483345208049286,
"uptime_hours": 0.0165231515625136
}
```
This shows how long the server has been running.## Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd datasette-uptime
python3 -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
pip install -e '.[test]'
```
To run the tests:
```bash
pytest
```