Prometheus Kubernetes service and deployment Prometheus Grafana service and deployment
- already configured Prometheus datasource
- alredey configured Grafana exapmle dashboard
Links
import http from 'k6/http'; | |
import { randomString } from 'https://jslib.k6.io/k6-utils/1.1.0/index.js'; | |
export const options = { | |
stages: [ | |
{ duration: '30s', target: 500 }, | |
{ duration: '2m', target: 1000 }, | |
{ duration: '30s', target: 0 } | |
] |
//usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS io.quarkus:quarkus-resteasy:2.4.1.Final | |
//DEPS io.quarkus:quarkus-micrometer-registry-prometheus:2.4.1.Final | |
//JAVAC_OPTIONS -parameters | |
//JAVA_OPTIONS -Djava.util.logging.manager=org.jboss.logmanager.LogManager | |
import io.quarkus.runtime.Quarkus; | |
import javax.enterprise.context.ApplicationScoped; |
Prometheus Kubernetes service and deployment Prometheus Grafana service and deployment
Links
# DISCLAIMER, this is not the best way to build a Docker Image. It is still WIP, so I find this way easier to modify. | |
FROM ubuntu:20.04 | |
ARG JAVA_VERSION=adoptopenjdk-8-hotspot | |
ARG MAVEN_VERSION=3.6.3 | |
# general stuff | |
RUN apt-get update | |
RUN apt-get install wget -y | |
RUN apt-get install apt-transport-https -y |
import matplotlib.pyplot as plt | |
import numpy as np | |
numberOfDays = 7 | |
minutesPerDay = 24 * 60 | |
def addNoise(array, noise=5): | |
# some random noise | |
return array + np.random.rand( len(array) ) * noise |
import datetime | |
now = datetime.datetime.now().replace(second=0, microsecond=0) | |
# I use replace method to round to second and microsecond, as datetime is inmutable | |
minutesInAWeek = 7 * 24 * 60 # 7 days in a week, 24 hours a day, 60 minutes an hour | |
for i in reversed(range(minutesInAWeek)): | |
minuteInThePast = now - datetime.timedelta(minutes = i) |