Recognos / Metrics.NET

The Metrics.NET library provides a way of instrumenting applications with custom metrics (timers, histograms, counters etc) that can be reported in various ways and can provide insights on what is happening inside a running application.
Apache License 2.0
640 stars 110 forks source link

.net standard support #76

Open yar1k0v opened 7 years ago

yar1k0v commented 7 years ago

Hi, is there any plans on porting the library to .net standard ?

Jericho commented 7 years ago

I have forked the repo and I am investigating what it would take to support netstandard. I will list the issues I discover (if any).

Jericho commented 7 years ago

Here are the issues I found that would need to be resolved to support netstandard:

  1. Several methods are decorated with [MethodImpl(MethodImplOptions.Synchronized)]. 'Synchronized' is not available in netstandard 1.6 (although it's rumored to be back in netstandard 2,0. I haven't verified)
  2. ConfigurationManager is not available in netstandard
  3. WebClient is not available in netstandard
  4. WebRequest is not available in netstandard
  5. HttpListener is not available in netstandard
  6. HttpListenerContext is not available in netstandard
  7. HttpListenerException is not available in netstandard
  8. HttpListenerRequest is not available in netstandard
  9. HttpListenerResponse is not available in netstandard
alhardy commented 7 years ago

@yar1k0v @Jericho see here for a related discussion

Crozin commented 7 years ago

I seems that .NET Standard 2.0 provides all necessary types except for ConfigurationManager.

Crozin commented 6 years ago

Any chance for update? As far as I know ConfigurationManager is used only as a convnient way to set up Metrics.Reports.ToleratedConsecutiveFailures, Metrics.HttpListener.HttpUriPrefix and Metrics.GlobalContextName from appSettings. That could be ommited in .NET Standard 2.0.

megakid commented 6 years ago

I am working on this - current work in progress is here: https://github.com/megakid/Metrics.NET/tree/netcore

rofr commented 6 years ago

@megakid Is the port going well? Need any help? Looks like most work is in the samples and adapters..

megakid commented 6 years ago

@rofr I think the port is pretty much done but I don't have any experience with Nancy and Owin. I have introduced a new AspNetCore adapter, pretty much copy pasted from Owin and tweaked.

Everything I have tested is working, I'll create a PR and would appreciate a review/comments.

megakid commented 6 years ago

https://github.com/Recognos/Metrics.NET/pull/91 Pull Request created.

rofr commented 6 years ago

@megakid awesome, I'll have a look. I'll also tell the nancy dev team, maybe one of them can help review.

elementum commented 6 years ago

Any news on this?

theazyfa commented 6 years ago

any update?

micdenny commented 6 years ago

here's my 2 cents:

https://github.com/Recognos/Metrics.NET/compare/master...micdenny:netcore

https://github.com/micdenny/Metrics.NET/tree/netcore

I've just convertered the main project Metrics and in this way all the performance counters works on netcore webapi projects that is what I need right now (normal metrics works with the actual fullfx version). I've tried adding the shims, but then a problem with async start throwing, so I've tried to do the less step to convert the in project in netcore and I did it adding only Microsoft.CSharp, System.Configuration.ConfigurationManager and System.Diagnostics.PerformanceCounter on top of netstandard2.0

yar1k0v commented 5 years ago

Looks like this project is dead.

megakid commented 5 years ago

We've moved to https://www.app-metrics.io/ which was forked from this project.

cocowalla commented 5 years ago

@megakid so... I'm confused - I thought this repo was continuing under @Recognos, while the app-metrics.io fork was created by someone else after some disagreements about how/when .NET Standard support should be implemented?

megakid commented 5 years ago

@megakid so... I'm confused - I thought this repo was continuing under @Recognos, while the app-metrics.io fork was created by someone else after some disagreements about how/when .NET Standard support should be implemented?

I'm not sure of the origins of app-metrics vs metrics.net but app-metrics is similar enough (API wise), seems to be more active and works well for us (e.g. my day job) in production. The number 1 reason we migrated away from this project is because we want to proceed with .NET Core ASAP and Metrics.NET was our main blocker.

I originally planned to do some work on Metrics.NET to help the .NET Core migration but wasn't able to devote much time to it, then we found app-metrics...

cocowalla commented 5 years ago

@megakid ah, I took "We've moved" to mean "we the original repo owners have moved"

yar1k0v commented 5 years ago

@megakid I know this project and my team is going to migrate on it as well since this project is not supported anymore.