Skip to content

Commit

Permalink
Renamed *TTextRenderer* to *TTextExposer*
Browse files Browse the repository at this point in the history
Renamed *TTextRenderer* to *TTextExposer* in order to respect conventions
  • Loading branch information
marcobreveglieri committed Mar 23, 2023
1 parent a64b8f3 commit 9d9312f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Source/Prometheus.Exposers.Text.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ interface

type

{ TTextRenderer }
{ TTextExposer }

/// <summary>
/// Provides methods to export metrics using the Prometheus text representation.
/// </summary>
TTextRenderer = class
TTextExposer = class
strict private
function EscapeToken(const AText: string): string;
function FormatNumber(const AValue: Double): string;
Expand Down Expand Up @@ -62,9 +62,9 @@ function TTextEncoding.GetPreamble: TBytes;
SetLength(Result, 0);
end;

{ TTextRenderer }
{ TTextExposer }

function TTextRenderer.EscapeToken(const AText: string): string;
function TTextExposer.EscapeToken(const AText: string): string;
begin
Result := AText
.Replace('\', '\\')
Expand All @@ -75,7 +75,7 @@ function TTextRenderer.EscapeToken(const AText: string): string;
.Replace('"', '\"');
end;

function TTextRenderer.FormatNumber(const AValue: Double): string;
function TTextExposer.FormatNumber(const AValue: Double): string;
begin
if AValue.IsNegativeInfinity then
begin
Expand All @@ -95,7 +95,7 @@ function TTextRenderer.FormatNumber(const AValue: Double): string;
Result := AValue.ToString;
end;

function TTextRenderer.Render(ASamples: TArray<TMetricSamples>): string;
function TTextExposer.Render(ASamples: TArray<TMetricSamples>): string;
begin
var LBuffer := TStringBuilder.Create;
try
Expand All @@ -106,7 +106,7 @@ function TTextRenderer.Render(ASamples: TArray<TMetricSamples>): string;
end;
end;

procedure TTextRenderer.Render(ABuilder: TStringBuilder; ASamples: TArray<TMetricSamples>);
procedure TTextExposer.Render(ABuilder: TStringBuilder; ASamples: TArray<TMetricSamples>);
begin
var LWriter := TStringWriter.Create(ABuilder);
try
Expand All @@ -116,7 +116,7 @@ procedure TTextRenderer.Render(ABuilder: TStringBuilder; ASamples: TArray<TMetri
end;
end;

procedure TTextRenderer.Render(AStream: TStream; ASamples: TArray<TMetricSamples>);
procedure TTextExposer.Render(AStream: TStream; ASamples: TArray<TMetricSamples>);
begin
var LEncoding := TTextEncoding.Create;
try
Expand All @@ -131,7 +131,7 @@ procedure TTextRenderer.Render(AStream: TStream; ASamples: TArray<TMetricSamples
end;
end;

procedure TTextRenderer.Render(AWriter: TTextWriter; ASamples: TArray<TMetricSamples>);
procedure TTextExposer.Render(AWriter: TTextWriter; ASamples: TArray<TMetricSamples>);
begin
// TODO: Check output if LMetricSet.Samples == 0
for var LMetricSet in ASamples do
Expand Down

0 comments on commit 9d9312f

Please sign in to comment.