Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve appearance of validation output #2179

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

YegorStepanov
Copy link
Contributor

Before #2148, like v0.13.2:
v013
Master:
Master
PR:
PR

no validation errors:

Master:
image

PR:
image

@YegorStepanov
Copy link
Contributor Author

What is the purpose of the double slash? Are they meant to show a newline in the console?
For example:
image

@AndreyAkinshin
Copy link
Member

We use double slashes to distinguish user messages from the payload (the results of the measurements).
@adamsitnik can we avoid using slashes with the help of our new Pipe approach?

@YegorStepanov
Copy link
Contributor Author

can we avoid using slashes with the help of our new #2092?

Yes, if we remove the first line or pass the NullLogger to the broker, the measurements and input from generated project will not be printed.

// TODO: implement Silent mode here
logger.WriteLine(LogKind.Default, line);
if (!line.StartsWith("//"))
{
Results.Add(line);
}

But how can we distinguish user input from measurements (it requires to implement silent mode)?

[Benchmark]
// I haven't tried this, but it looks like we can break the engine.
public void M() => Console.WriteLine("OverheadJitting  100500: 99 op, 24 h, 0 us/op ");

Because it's just parsing the input:

/// <summary>
/// Parses the benchmark statistics from the plain text line.
///
/// E.g. given the input <paramref name="line"/>:
///
/// WorkloadTarget 1: 10 op, 1005842518 ns
///
/// Will extract the number of <see cref="Operations"/> performed and the
/// total number of <see cref="Nanoseconds"/> it took to perform them.
/// </summary>
/// <param name="line">The line to parse.</param>
/// <param name="processIndex">Process launch index, indexed from one.</param>
/// <returns>An instance of <see cref="Measurement"/> if parsed successfully. <c>Null</c> in case of any trouble.</returns>
// ReSharper disable once UnusedParameter.Global
public static Measurement Parse(string line, int processIndex)
{
if (string.IsNullOrWhiteSpace(line) || line.StartsWith(GcStats.ResultsLinePrefix))
return Error();
try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants