mirror of
https://github.com/yavook/kiwi-simple-metrics.git
synced 2024-12-04 12:52:59 +00:00
preparation for release 0.1.0
This commit is contained in:
parent
4205b04b05
commit
a5b0cbe396
5 changed files with 29 additions and 34 deletions
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
|
@ -13,7 +13,7 @@
|
||||||
"METRIC__INTERVAL": "5",
|
"METRIC__INTERVAL": "5",
|
||||||
"METRIC__LOG__ENABLED": "True",
|
"METRIC__LOG__ENABLED": "True",
|
||||||
"METRIC__DISK__PATHS": "[\"/var\", \"/\", \"/dev\"]",
|
"METRIC__DISK__PATHS": "[\"/var\", \"/\", \"/dev\"]",
|
||||||
"METRIC__EXTERNAL__EXECUTABLES": "[\"${workspaceFolder}/dummy-metric\"]",
|
"METRIC__EXTERNAL__EXECUTABLES": "[\"${workspaceFolder}/example/dummy-metric\"]",
|
||||||
},
|
},
|
||||||
"justMyCode": true
|
"justMyCode": true
|
||||||
}
|
}
|
||||||
|
|
20
Dockerfile
Normal file
20
Dockerfile
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
FROM python:3.11-alpine
|
||||||
|
|
||||||
|
ENV \
|
||||||
|
PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
# buildtime deps
|
||||||
|
apk add --no-cache \
|
||||||
|
--virtual .build-deps \
|
||||||
|
build-base \
|
||||||
|
gcc \
|
||||||
|
linux-headers \
|
||||||
|
;
|
||||||
|
|
||||||
|
RUN set -ex; \
|
||||||
|
pip3 --no-cache-dir install /usr/src/app
|
||||||
|
|
||||||
|
ENTRYPOINT ["kiwi-simple-metrics"]
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "Dummy"
|
|
||||||
echo "95"
|
|
||||||
echo "normal"
|
|
||||||
awk "BEGIN{srand(); r=rand(); print r * 100}"
|
|
||||||
|
|
||||||
exit 0
|
|
8
example/dummy-metric
Executable file
8
example/dummy-metric
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Dummy" # name
|
||||||
|
echo "95" # threshold
|
||||||
|
echo "normal" # inversion
|
||||||
|
awk "BEGIN{srand(); r=rand(); print r * 100}" # value
|
||||||
|
|
||||||
|
exit 0
|
|
@ -1,25 +0,0 @@
|
||||||
from pydantic import BaseModel
|
|
||||||
|
|
||||||
|
|
||||||
class SubModel(BaseModel):
|
|
||||||
optional: int = 42
|
|
||||||
required: str
|
|
||||||
|
|
||||||
|
|
||||||
class Settings(BaseModel):
|
|
||||||
sub: SubModel = SubModel(required="foo")
|
|
||||||
sub2: SubModel = SubModel(required="bar")
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
|
||||||
settings = Settings.model_validate({
|
|
||||||
"sub": {"optional": "69"},
|
|
||||||
})
|
|
||||||
|
|
||||||
# settings = Settings()
|
|
||||||
|
|
||||||
print(settings.model_dump())
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
Loading…
Reference in a new issue