Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:27
    ismaelhamed opened #4599
  • Oct 30 23:32
    simonlaroche opened #155
  • Oct 30 18:42
    dependabot-preview[bot] synchronize #4337
  • Oct 30 18:42

    dependabot-preview[bot] on nuget

    Bump FSharp.Quotations.Evaluato… (compare)

  • Oct 30 18:42
    dependabot-preview[bot] edited #4337
  • Oct 30 18:41
    Aaronontheweb synchronize #4598
  • Oct 30 18:41
    Aaronontheweb commented #4136
  • Oct 30 18:41
    Aaronontheweb milestoned #4136
  • Oct 30 18:41
    Aaronontheweb demilestoned #4136
  • Oct 30 18:41
    dependabot-preview[bot] edited #4337
  • Oct 30 18:41
    Aaronontheweb milestoned #4375
  • Oct 30 18:41

    Aaronontheweb on dev

    Double wildcard implementation … (compare)

  • Oct 30 18:41
    Aaronontheweb closed #4375
  • Oct 30 14:32
    IgorFedchenko commented #4375
  • Oct 30 14:20
    Aaronontheweb commented #4375
  • Oct 30 13:27
    Aaronontheweb commented #4375
  • Oct 30 13:27
    Aaronontheweb synchronize #4375
  • Oct 30 13:25
    IgorFedchenko commented #4375
  • Oct 30 02:22
    to11mtm commented #4594
  • Oct 30 02:22
    to11mtm commented #4594
Aaron Stannard
@Aaronontheweb
btw - going to be upgrading the build server to support C# 6, F# 4, and Code Contracts soon
I just have to install a new version of Visual Studio and do some other song and dance
Bartosz Sypytkowski
@Horusiath
+1000 for code contracts
I'll see what I can do
Aaron Stannard
@Aaronontheweb
yeah, I fell in love with them on DotNetty
started using them in NBench, which I'm hoping to have a demo of in our contributors meeting
Bartosz Sypytkowski
@Horusiath
pretty bad, that they should be basically compiler feature ;)
Aaron Stannard
@Aaronontheweb
yeah, I agree with that haha
NBench is something I came up with while I was on vacation - to build a robust history going forward around performance in key areas of Akka.NET, Helios, DotNetty, and our serializers
combines profiling techniques with unit testing
i.e. write a unit test that guarantees that a benchmark never has more than N GC2 collections during each run
Bartosz Sypytkowski
@Horusiath
@Aaronontheweb I'd also focus on that: http://www.privateeye.io/
it's in beta and it's pretty impressive right now - I've talked with greg young, and he wants to keep it free for OSS projects
Aaron Stannard
@Aaronontheweb
cool - what I want is automated performance testing though
i.e. something that screams and fails loudly when a key metric gets fucked up on a PR
Bartosz Sypytkowski
@Horusiath
yeah I know, this is more for profiling
Aaron Stannard
@Aaronontheweb
.NET needs better profiling tools
PerfView has been what I've been using
and it's a bit of a bear to be honest
if you're a Microsoft engineer and have spent a lot of time working with Event Tracing for Windows, PerfView is probably amazing
PrivateEye looks cool
Bartosz Sypytkowski
@Horusiath
this one has metrics about bytes used, nr of calls, allocations and more - and what's the best it works from F# Repl, can be used on living code and composed via observables with any UI you want
Aaron Stannard
@Aaronontheweb
would love to use that for troubleshooting issues with the performance-critical parts
Ashit Shakrani
@ashshak
Hi Guys,
I am just spiking the FSM and can't get it to transition to the 2nd state, am I missing anything here:
public MyFsm()
        {
            MyStates myStates = new MyStates(); 
            StartWith(myStates.Ready, new MyData());

            When(myStates.Ready, @event =>
            {
                State<MyState, MyData> nextState=null;

                @event.FsmEvent.Match()
                    .With<MyEvents.Calculate>(calculate =>
                    {
                        StateData.Item1 = calculate.Item1;
                        StateData.Item2 = calculate.Item2;
                        nextState = GoTo(myStates.Calculating, StateData);
                    })
                    .Default(o =>
                    {
                        nextState = Stay();
                    });

                return nextState;
            });

            When(myStates.Calculating, @event =>
            {
                StateData.Sum = StateData.Item1 + StateData.Item2;
                return GoTo(myStates.Calculated, StateData);
            });
            Initialize();
        }
Aaron Stannard
@Aaronontheweb
@ashshak can you show the full FSM code along with the messages you're sending it?
Ashit Shakrani
@ashshak
sure, here a gist:
https://gist.github.com/ashshak/211a7323a78065558b43
Thanks for having a look.
Aaron Stannard
@Aaronontheweb
ah, I think I may know why.. can you verify that the GoTo(myStates.Calculating, StateData) is being called?
with the debugger?
Ashit Shakrani
@ashshak
yes the event is being pattern-matched and nextState is being set.
Aaron Stannard
@Aaronontheweb
ok, I think I might know what's up
this is from the internals of the FSM<TState, TData> class
private void ProcessEvent(Event<TData> fsmEvent, object source)
        {
            if(DebugEvent)
            {
                var srcStr = GetSourceString(source);
                _log.Debug("processing {0} from {1}", fsmEvent, srcStr);
            }
            var stateFunc = _stateFunctions[_currentState.StateName];
            var oldState = _currentState;
            State<TState, TData> upcomingState = null;

            if(stateFunc != null)
            {
                upcomingState = stateFunc(fsmEvent);
            }

            if(upcomingState == null)
            {
                upcomingState = HandleEvent(fsmEvent);
            }

            ApplyState(upcomingState);
            if(DebugEvent && !Equals(oldState, upcomingState))
            {
                _log.Debug("transition {0} -> {1}", oldState, upcomingState);
            }
        }
this is where a state transition occurs
the stateFunc this in case is your lambda inside the Where( clause
ah, nevermind - I'm an idiot
turn on the following setting in HOCON
Ashit Shakrani
@ashshak
yup, I saw the source file. And even the handler for OnTransition() is firing. But it never enters the stateFunc of the 2nd state.
Aaron Stannard
@Aaronontheweb
akka.loglevel = DEBUG
this will print out the _log.Debug("transition {0} -> {1}", oldState, upcomingState); messages to the console
so you'll know for certain if the transition occurs
I think you are transitioning to the second state
but you need to send another event
right now nothing is handled in that state
events don't cascade
they're handled and cause a transition
Ashit Shakrani
@ashshak
ok, I see. I have just fired another message and it now hits handler. I thought I could just move from one to another. Thanks for your help.
Aaron Stannard
@Aaronontheweb
no worries @ashshak - it was a good gut check for me too
the thing I was worried about was using nullable types to define states
since we do so many STATE1 == STATE2 comparisons