A gauge reading.
models
Source src/Telemetry.ts:815 lines
export class class GaugeDatumclass GaugeDatum {
_tag: 'Gauge';
id: string;
labels: { readonly [x: string]: string };
value: number;
}
A gauge reading.
GaugeDatum extends import SchemaSchema.const TaggedClass: <GaugeDatum, {}>(identifier?: string) => {
<Tag, Fields>(tag: Tag, fields: Fields, annotations?: Schema.Annotations.Declaration<GaugeDatum, readonly [Schema.TaggedStruct<Tag, Fields>]> | undefined): Schema.Class<GaugeDatum, Schema.TaggedStruct<Tag, Fields>, {}>;
<Tag, S>(tag: Tag, schema: S, annotations?: Schema.Annotations.Declaration<GaugeDatum, readonly [Schema.Struct<{ [K in keyof ({
readonly _tag: Schema.tag<Tag>;
} & S["fields"])]: ({
readonly _tag: Schema.tag<Tag>;
} & S["fields"])[K]; }>]> | undefined): Schema.Class<...>;
}
Defines a schema-backed class with an automatically populated _tag field.
When to use
Use to define class instances that are validated by a schema and participate
in tagged union matching.
Details
The optional identifier parameter overrides the schema identifier;
it defaults to the tag value.
Example (Defining a tagged class)
import { Schema } from "effect"
class Circle extends Schema.TaggedClass<Circle>()("Circle", {
radius: Schema.Number
}) {}
const c = new Circle({ radius: 5 })
console.log(c._tag) // "Circle"
console.log(c.radius) // 5
TaggedClass<class GaugeDatumclass GaugeDatum {
_tag: 'Gauge';
id: string;
labels: { readonly [x: string]: string };
value: number;
}
A gauge reading.
GaugeDatum>()("Gauge", {
id: Schema.String(property) id: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
id: import SchemaSchema.const String: Schema.Stringconst String: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<string, readonly []>) => Schema.String;
annotateKey: (annotations: Schema.Annotations.Key<string>) => Schema.String;
check: (checks_0: Check<string>, ...checks: Array<Check<string>>) => Schema.String;
rebuild: (ast: String) => Schema.String;
make: (input: string, options?: Schema.MakeOptions) => string;
makeOption: (input: string, options?: Schema.MakeOptions) => Option<string>;
makeEffect: (input: string, options?: Schema.MakeOptions) => Effect.Effect<string, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
String
.
Schema for string values. Validates that the input is typeof "string".
String,
labels: Schema.$Record<
Schema.String,
Schema.String
>
(property) labels: {
Type: Record.Type<Key, Value>;
Encoded: Record.Encoded<Key, Value>;
DecodingServices: Record.DecodingServices<Key, Value>;
EncodingServices: Record.EncodingServices<Key, Value>;
Iso: Record.Iso<Key, Value>;
key: Key;
value: Value;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly [x: string]: string; }, readonly []>) => Schema.$Record<Schema.String, Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: string }>) => Schema.$Record<Schema.String, Schema.String>;
check: (checks_0: Check<{ readonly [x: string]: string }>, ...checks: Array<Check<{ readonly [x: string]: string }>>) => Schema.$Record<Schema.String, Schema.String>;
rebuild: (ast: Objects) => Schema.$Record<Schema.String, Schema.String>;
make: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => { readonly [x: string]: string };
makeOption: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => Option<{ readonly [x: string]: string }>;
makeEffect: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly [x: string]: string }, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
labels: const metricLabels: Schema.$Record<
Schema.String,
Schema.String
>
const metricLabels: {
Type: Record.Type<Key, Value>;
Encoded: Record.Encoded<Key, Value>;
DecodingServices: Record.DecodingServices<Key, Value>;
EncodingServices: Record.EncodingServices<Key, Value>;
Iso: Record.Iso<Key, Value>;
key: Key;
value: Value;
Rebuild: Rebuild;
ast: Ast;
annotate: (annotations: Schema.Annotations.Bottom<{ readonly [x: string]: string; }, readonly []>) => Schema.$Record<Schema.String, Schema.String>;
annotateKey: (annotations: Schema.Annotations.Key<{ readonly [x: string]: string }>) => Schema.$Record<Schema.String, Schema.String>;
check: (checks_0: Check<{ readonly [x: string]: string }>, ...checks: Array<Check<{ readonly [x: string]: string }>>) => Schema.$Record<Schema.String, Schema.String>;
rebuild: (ast: Objects) => Schema.$Record<Schema.String, Schema.String>;
make: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => { readonly [x: string]: string };
makeOption: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => Option<{ readonly [x: string]: string }>;
makeEffect: (input: { readonly [x: string]: string }, options?: Schema.MakeOptions) => Effect.Effect<{ readonly [x: string]: string }, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
metricLabels,
value: Schema.Number(property) value: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<number, readonly []>) => Schema.Number;
annotateKey: (annotations: Schema.Annotations.Key<number>) => Schema.Number;
check: (checks_0: Check<number>, ...checks: Array<Check<number>>) => Schema.Number;
rebuild: (ast: Number) => Schema.Number;
make: (input: number, options?: Schema.MakeOptions) => number;
makeOption: (input: number, options?: Schema.MakeOptions) => Option<number>;
makeEffect: (input: number, options?: Schema.MakeOptions) => Effect.Effect<number, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
value: import SchemaSchema.const Number: Schema.Numberconst Number: {
Rebuild: Rebuild;
Iso: Iso;
ast: Ast;
Type: T;
Encoded: E;
DecodingServices: RD;
EncodingServices: RE;
annotate: (annotations: Schema.Annotations.Bottom<number, readonly []>) => Schema.Number;
annotateKey: (annotations: Schema.Annotations.Key<number>) => Schema.Number;
check: (checks_0: Check<number>, ...checks: Array<Check<number>>) => Schema.Number;
rebuild: (ast: Number) => Schema.Number;
make: (input: number, options?: Schema.MakeOptions) => number;
makeOption: (input: number, options?: Schema.MakeOptions) => Option<number>;
makeEffect: (input: number, options?: Schema.MakeOptions) => Effect.Effect<number, Schema.SchemaError, never>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Type-level representation of
Number
.
Schema for number values, including NaN, Infinity, and -Infinity.
Details
Default JSON serializer:
- Finite numbers are serialized as numbers.
- Non-finite values are serialized as strings (
"NaN", "Infinity", "-Infinity").
Number,
}) {}
Referenced by 2 symbols