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

Adding metrics via the AppMetrics libraries. #9

Closed
wants to merge 13 commits into from

Commits on Mar 25, 2021

  1. Adding metrics via the AppMetrics libraries. Tracking cache events: H…

    …IT, MISS, STALE_HIT, STALE_REFRESH
    JosephEShook committed Mar 25, 2021
    Configuration menu
    Copy the full SHA
    cf0fdb8 View commit details
    Browse the repository at this point in the history
  2. House keeping.

    JosephEShook committed Mar 25, 2021
    Configuration menu
    Copy the full SHA
    af6eb3f View commit details
    Browse the repository at this point in the history

Commits on Mar 26, 2021

  1. Configuration menu
    Copy the full SHA
    3b5e4a5 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'main' of https://github.com/jodydonetti/ZiggyCreatures.…

    …FusionCache into appmetrics
    
    # Conflicts:
    #	src/ZiggyCreatures.FusionCache/FusionCache.cs
    JosephEShook committed Mar 26, 2021
    Configuration menu
    Copy the full SHA
    d171abe View commit details
    Browse the repository at this point in the history
  3. Trying out a Plug-in/Provider model. Two IFusionMetrics imlementation…

    …s. One uses App.Metrics libarary and the other is .NET Core EventSource/EventCounter implementation. Of course the providers should be pushed to there own repos and nuget packages.
    
    Be warned I locally I packed them and consumed them as nuget packages.  But looks like it works well.  I experimented with the FusionCache.AppMetrics package in a project.  But still need to try the FusionCache.EventCounters in a project with multiple caches.  Not sure if what I did will be friendly to multiple caches yet.  But the bench marks for FusionCache.EventCounters is better than FusionCache.AppMetrics.
    JosephEShook committed Mar 26, 2021
    Configuration menu
    Copy the full SHA
    ab86397 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2021

  1. Finally got to a happier implementation of a EventSource style plugin…

    … in the ZiggyCreatures.Fusion.EventCounters. More work to do on validation but both AppMetrics and EventSource are usable.
    JosephEShook committed Mar 31, 2021
    1 Configuration menu
    Copy the full SHA
    307ff46 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2021

  1. Roughing in docs for Metrics plugins.

    Wiring in Item_Count.  Work still in progress.
    JosephEShook committed Apr 1, 2021
    Configuration menu
    Copy the full SHA
    d1562bd View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2021

  1. The ITEM_COUNT counter is just not tracking correctly. The technique …

    …to increment and decrement for various events hasn't worked yet. It also made me question if it was the right way to do it. I think if the cache implements Count then that is the way to poll a current count. With the FusionCache.EventCounter I am committing some experimental work.
    
    Friction Points:
      - IMemoryCache does not have a Count property.  I  have to Inject my own MemoryCache.
      - AddFusionCache extension method does not have a IMemoryCache parameter.  Not a big deal
      - Some usage pattern I have in a project involve some undesirable singletons that store IFusionMetrics and now I would have to take on the IMemoryCache also.  Kind of stuck with this pattern for a while.  Modernizing takes time :(.
    
    The experiment results in accurate counts.  Still need to unwire the old way of tracking but this all brings me to a change to the way I inject IFusionMetrics.
    
    My provider pattern of passing IFusionMetrics would be better implemented with a Plugin that is loaded based on assembly scanning at startup.  Then IFusionMetrics and IFusionCache wouldn’t both have to be passed an IMemoryCache.  The FusionCache implementation would give IFusionMetrics the IMemoryCache.   The implementation of IFusionMetrics would code for the existence of a Count property implementation.
    JosephEShook committed Apr 4, 2021
    Configuration menu
    Copy the full SHA
    191c1a9 View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2021

  1. Switched to plugin technique. Some tests started. CacheName is still …

    …in FusionCache constructor. Need name to name metrics when a project has multiple caches that I want to measure via metrics. Maybe a first class cacheName property on FusionCacheOptions would be a better way to go?
    
    This plugin technique made my consumption side much easier when using the FusionCache.EventCounter Plugin.
    JosephEShook committed Apr 6, 2021
    Configuration menu
    Copy the full SHA
    dae9cfa View commit details
    Browse the repository at this point in the history
  2. Merge branch 'main' of https://github.com/jodydonetti/ZiggyCreatures.…

    …FusionCache into appmetrics
    
    # Conflicts:
    #	src/ZiggyCreatures.FusionCache/FusionCache.cs
    #	src/ZiggyCreatures.FusionCache/ZiggyCreatures.FusionCache.csproj
    #	src/ZiggyCreatures.FusionCache/ZiggyCreatures.FusionCache.xml
    JosephEShook committed Apr 6, 2021
    Configuration menu
    Copy the full SHA
    3f8c878 View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2021

  1. Tried out a assembly scanner plugin technique. In the end I decide ag…

    …ainst it.
    
    EventCounter plugin must provide a MemoryCache if a user wants ITEM_COUNT counters.
    Core unit tests added for metrics that match all the SingleLevelTests tests.  This was good as I found a few places to change where measurements are triggered.
    Added two new benchmark tests: one for AppMetrics plugin and one for EventCounters plugin.
    
    Of course, we need to extract the plugins and probably associated benchmark project out into their own GitHub projects.
    JosephEShook committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    fcabeb7 View commit details
    Browse the repository at this point in the history
  2. Dropping the Metrics Plugins from this PR. Will maintain them in my m…

    …etrics_with_plugins branch. For now.
    
    Just trying to get this back to a clean PR state independent of external dependencies.
    JosephEShook committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    ea5a566 View commit details
    Browse the repository at this point in the history
  3. Fix-up builds.

    JosephEShook committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    2cccc39 View commit details
    Browse the repository at this point in the history