Giter Site home page Giter Site logo

Comments (6)

ycrumeyrolle avatar ycrumeyrolle commented on May 16, 2024

In addition, you may be able to use the result of the Task.WhenAll instead of the task.Value.Result in the for each Health Service loop.

from healthchecks.

bradwilson avatar bradwilson commented on May 16, 2024

It is not necessary to be thread safe in this class if the Health Service do not add the results in different threads.

It became necessary when parallelizing the checks (the ConcurrentDictionary is used to register the results).

you may be able to use the result of the Task.WhenAll

If you'll notice, the loop needed to preserve both the key and the task, so you can't use the results of the Task.WhenAll, because it's waiting on the task inside the projection, but my loop needs both the key and the task.

from healthchecks.

ycrumeyrolle avatar ycrumeyrolle commented on May 16, 2024

The CompositeHealthCheckResult.Add () is used within a sequential for each.
The parallel flow is execute by the Task.WhenAll just before, which is awaited.

The key used in the loop is the name of the check. The HealthCheckResult does not have this property, but it could be added.

from healthchecks.

bradwilson avatar bradwilson commented on May 16, 2024

I think you missed this: https://github.com/aspnet/HealthChecks/blob/93360725a04eb2270a537e41bb0b67094e39e997/src/Microsoft.Extensions.HealthChecks/Internal/UrlChecker.cs#L47

from healthchecks.

ycrumeyrolle avatar ycrumeyrolle commented on May 16, 2024

I totally missed it.
I am not sure that current implementation of http check is mature.
Http check will probably require authentication specific for each endpoint, and may be a custom validation extension point, because some endpoint returns 200 even in case of errors, or some endpoint returns 500 or 400 even if not in error.
Why allowing multicheck within this check and not in the others? If if is for a simpler registration, this can be done with a builder provider multiple checkers instead of a single multichecker.

When I look at the UrlChecker implementation, is see a lot of similitude to the HealthCheckService. I though that the check flow were managed by the service, but it is also managed by the checkers. You are what I mean?

from healthchecks.

bradwilson avatar bradwilson commented on May 16, 2024

The role of multi-checks within UrlChecker may change depending on whether we choose to support grouping (see #16). Generalized grouping would alleviate the need to UrlCheck vs. UrlChecks. /cc @glennc

from healthchecks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.