-
Notifications
You must be signed in to change notification settings - Fork 71
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
[WIP] #96 dotnet core support #204
Conversation
Might have a show stopper for now with StackFrame, which @haf has already commented on: https://github.com/dotnet/corefx/issues/1420#issuecomment-96288400 Looks like it is in net standard 2.0 https://github.com/dotnet/corefx/pull/12527/commits. From my understanding we'll have to wait till then. Unless anyone has a workaround. |
I suggest that we simply remove |
src/Logary/DataModel.fs
Outdated
@@ -1559,7 +1561,7 @@ module Message = | |||
|
|||
[<CompiledName "SetTimestamp">] | |||
let setTimestamp (instant : Instant) msg = | |||
{ msg with timestamp = instant.Ticks * Constants.NanosPerTick } | |||
{ msg with timestamp = (instant |> Date.getTicks) * Constants.NanosPerTick } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer the non-piped version when you have only a single argument.
I do have Logary main compiling with a big hack regarding StackFrame: 25e3607#diff-7ec805bc41571a034ed354f519900efeR35 I'm sure this is WRONG and would cause problems but it does mean that's probably the only place we'll have problems. |
@@ -597,14 +597,16 @@ module Debugger = | |||
ack *<= () :> Job<_> | |||
|
|||
RingBuffer.take requests ^=> function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of this target should be conditionally compiled if it doesn't exist on .Net Core. To be honest I never use it and I don't know if someone else it; it's just a 'hey - it's easy to create new targets'-target for me.
src/Logary/Targets_Core.fs
Outdated
let hourly = FileAge (Duration.FromHours 1L) | ||
let daily = FileAge (Duration.FromHours 24L) | ||
let weekly = FileAge (Duration.FromHours (7L * 24L)) | ||
let everyMinute = FileAge (Internals.Date.Duration.fromMinutes 1L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain a bit about why you modelled the API like this? E.g. isn't Date
implying there's no time: hours, minute, seconds, millis etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just cruft from the Nodatime API changes. Should be back to normal soon.
src/Logary/Targets_Core.fs
Outdated
@@ -1224,7 +1228,7 @@ module File = | |||
if maxSize <= size then true else apply state rest | |||
| FileAge maxAge :: rest -> | |||
let created = Instant.FromDateTimeUtc(state.fileInfo.CreationTimeUtc) | |||
let age = created - clock.Now | |||
let age = created - (clock |> Internals.Date.getInstant) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single arg, then don't use |>
src/Logary/Targets_Graphite.fs
Outdated
@@ -71,7 +71,7 @@ module Impl = | |||
/// All graphite messages are of the following form. | |||
/// metric_path value timestamp\n | |||
let createMsg (path : String) value (timestamp : Instant) = | |||
let line = String.Format("{0} {1} {2}\n", path, value, timestamp.Ticks / NodaConstants.TicksPerSecond) | |||
let line = String.Format("{0} {1} {2}\n", path, value, (timestamp |> Internals.Date.getTicks ) / NodaConstants.TicksPerSecond) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps extension method on Instant
like instant.ticks
? Why shim it in the first place? Can't NodaTime be upgraded instead? https://www.nuget.org/packages/NodaTime/2.0.0-alpha20160729
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I just didn't want to decide to update Nodatime on the full framework. But we totally could do just that and get rid of that nonsense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's alright since v4 is still in beta. I haven't frozen the API yet, but we're really getting there. The last couple of weeks have brought tremendous improvements (IMO).
Since the tests are in expecto, should we bother porting them for now? |
@TheAngryByrd Expecto got .Net Core support yesterday haf/expecto#4 |
So I just need to wait for the nuget package right? |
Rebase needed. Expecto has had its PR merged https://github.com/haf/expecto/releases/tag/v2.0.0 and haf/expecto#4 but actually releasing a nuget with it is contingent on this improvement request in albacore: Albacore/albacore#221 Meanwhile expecto could be compiled with .net core support locally to further this PR. |
I'm planning to make DVar a dependency for Logary https://github.com/haf/DVar/releases/tag/v0.1.0 – it's a single file of 125 lines of code that depends on This will enable the use-case of having targets transparently reconfiguring their endpoints based on load-balancing and services going up or down. Or another use-case could be load-balancing for a cluster (access to three different kafka-servers, rather than a single one), or another one could be client stickyness to a server. The actual use-case I'm introducing it for is that Windows Performance Counters can suddenly "disappear" which means they have to be re-queried; this happens whenever more than one process with an identical executable-name is started and queries for its own performance counters. |
Ok, I'll try to rebase it tonight. For expecto, Have you compiled and referenced locally before? The only thing google is telling me is to create a nuget package and host it locally on my file system. Seems like a pain (but i guess this is .net core after all), any guidance is appreciated. If you're planning on using paket files for the Dvar, it looks like it should just work. Probably just add to the project.json like: https://github.com/logary/logary/blob/102e7b99c3027452ca8ab7653a239813befd3435/src/Logary/project.json#L8 |
Hi Jimmy, Yes, you can compile it locally to create the package, then place the path of the folder that the nuget is in, inside a This should work for .Net core as well. |
This is only really blocked on Albacore/albacore#221 now. |
The debugging may not be needed any more? https://github.com/haf/expecto/blob/master/.travis.yml#L28 |
I can get it to build on osx locally just fine, I'm just derping over travis for some reason. |
Appveyor: Uhhh... what? Is expecto throwing on whitespace?
Travis: Whyyyyy, builds locally on osx fine
|
@TheAngryByrd My guess is that you've discovered that whitespace can indeed be passed as parameters to processes, just that you need to use the API of the operating system. It sounds like a parsing error in Argu stemming from this, rather than bugs in Expecto. |
Curious as to why it's windows specific though. Guess I'll try to reprodice with Argu. |
What is the .NET Coreapp 2.0 status for Logary? This 7/10 seems pretty good, last update at June, and now the Coreapp 2.0 is already released. Could we get an alpha-Nuget-package, please? :-) |
This is a work in progress. I've opened this PR early so I can get feedback.
This will add dotnet core support to Logary. Should close #96.
Things that I think need to be done, please correct me if I'm wrong: