mirror of
https://github.com/codex-storage/cs-codex-dist-tests.git
synced 2025-02-23 09:18:35 +00:00
44 lines
1.0 KiB
C#
44 lines
1.0 KiB
C#
using KubernetesWorkflow;
|
|
using Utils;
|
|
|
|
namespace MetricsPlugin
|
|
{
|
|
public interface IMetricsScrapeTarget
|
|
{
|
|
string Name { get; }
|
|
Address Address { get; }
|
|
}
|
|
|
|
public interface IHasMetricsScrapeTarget
|
|
{
|
|
IMetricsScrapeTarget MetricsScrapeTarget { get; }
|
|
}
|
|
|
|
public interface IHasManyMetricScrapeTargets
|
|
{
|
|
IMetricsScrapeTarget[] ScrapeTargets { get; }
|
|
}
|
|
|
|
public class MetricsScrapeTarget : IMetricsScrapeTarget
|
|
{
|
|
public MetricsScrapeTarget(Address address, string name)
|
|
{
|
|
Address = address;
|
|
Name = name;
|
|
}
|
|
|
|
public MetricsScrapeTarget(string ip, int port, string name)
|
|
: this(new Address("http://" + ip, port), name)
|
|
{
|
|
}
|
|
|
|
public MetricsScrapeTarget(RunningContainer container, string portTag)
|
|
: this(container.GetAddress(portTag), container.Name)
|
|
{
|
|
}
|
|
|
|
public string Name { get; }
|
|
public Address Address { get; }
|
|
}
|
|
}
|