* update swagger * remove unused models in converter * remove netcore3.1 from testr * bump ver * fix convert * remove some unused autorest property * move some clz from autorest to client * fix import * no longer expose SendRequestRaw * make file utils inner * fix build * c# 11
31 lines
859 B
C#
Executable File
31 lines
859 B
C#
Executable File
using k8s;
|
|
using Prometheus;
|
|
using System;
|
|
using System.Net.Http;
|
|
using System.Threading;
|
|
|
|
namespace prom
|
|
{
|
|
internal class Prometheus
|
|
{
|
|
private static void Main(string[] args)
|
|
{
|
|
var config = KubernetesClientConfiguration.BuildDefaultConfig();
|
|
var handler = new PrometheusHandler();
|
|
IKubernetes client = new Kubernetes(config, new DelegatingHandler[] { handler });
|
|
|
|
var server = new MetricServer(hostname: "localhost", port: 1234);
|
|
server.Start();
|
|
|
|
Console.WriteLine("Making requests!");
|
|
while (true)
|
|
{
|
|
client.CoreV1.ListNamespacedPod("default");
|
|
client.CoreV1.ListNode();
|
|
client.AppsV1.ListNamespacedDeployment("default");
|
|
Thread.Sleep(1000);
|
|
}
|
|
}
|
|
}
|
|
}
|