GithubHelp home page GithubHelp logo

csainty / glimpse.ravendb Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 9.0 1.74 MB

RavenDb Profiling plugin for Glimpse

Home Page: http://csainty.github.com/Glimpse.RavenDb

License: MIT License

C# 99.82% Shell 0.18%

glimpse.ravendb's Introduction

Glimpse.RavenDb is a RavenDb profiling plugin for Glimpse.

###Status As I don't currently use RavenDB in production, this plug-in is largely abandoned. I'll make occasional updates when it is interesting to me, but I encourage you to fork it if it is critical for your team.

###Install There are two ways to hook your RavenDb DocumentStore into the plugin.

  1. Explicitly via Glimpse.RavenDb.Profiler.AttachTo()
  2. Web.Config via the Glimpse.RavenDb.DocumentStoreApplicationKey AppSetting.

You can also filter senstive data out of your documents by either

  1. Calling Glimpse.RavenDb.Profiler.HideFields()
  2. Adding a Glimpse.RavenDb.HiddenFields AppSetting.

###Example DocumentStore Creation

var store = new DocumentStore();
store.Initialize();
Application["MyDocStore"]= store;

###Explicit

Glimpse.RavenDb.Profiler.AttachTo(store);
Glimpse.RavenDb.Profiler.HideFields("PasswordHash", "PasswordSalt");

###Web.Config

<appSettings>
	<add key="Glimpse.RavenDb.DocumentStoreApplicationKey" value="MyDocStore" />
	<add key="Glimpse.RavenDb.HiddenFields" value="PasswordHash,PasswordSalt" />
</appSettings>

###Learn More

RavenDb - http://www.ravendb.net
Glimpse - http://www.getglimpse.com
Chris Sainty - http://blog.csainty.com | @csainty

glimpse.ravendb's People

Contributors

csainty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

glimpse.ravendb's Issues

NullReferenceException when executing a query.ToList()

This is related to the Glimpse.RavenDb.Profiler. When I execute a particular query, I get the below error.

        An exception of type 'System.NullReferenceException' occurred in Glimpse.AspNet.dll but was not handled in user code

        Additional information: Object reference not set to an instance of an object.
       at Glimpse.AspNet.AspNetFrameworkProvider.get_HttpRequestStore()
       at Glimpse.Core.Framework.Factory.<>c__DisplayClass2.<InstantiateTimerStrategy>b__1()
       at Glimpse.RavenDb.Profiler.DurationOnTimeline(String message, DateTime startTime, TimeSpan duration) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 112
       at Glimpse.RavenDb.Profiler.EndRequest(Object sender, RequestResultArgs e) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 92
       at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
       at Raven.Client.Connection.HttpJsonRequestFactory.InvokeLogRequest(IHoldProfilingInformation sender, Func`1 generateRequestResult)
       at Raven.Client.Connection.HttpJsonRequest.ReadJsonInternal(Func`1 getResponse)
       at Raven.Client.Connection.HttpJsonRequest.ReadResponseJson()
       at Raven.Client.Connection.ServerClient.DirectQuery(String index, IndexQuery query, OperationMetadata operationMetadata, String[] includes, Boolean metadataOnly, Boolean includeEntries)
       at Raven.Client.Connection.ServerClient.<>c__DisplayClass62.<Query>b__61(OperationMetadata u)
       at Raven.Client.Connection.ReplicationInformer.TryOperation[T](Func`2 operation, OperationMetadata operationMetadata, OperationMetadata primaryOperationMetadata, Boolean avoidThrowing, T& result, Boolean& wasTimeout)

Not much more clue is given - any idea what is wrong? Is this a bug in the profiler? If I switch off the RavenDB profiler, it works fine so I'm assuming it is.

Feel free to ask for further information to replicate the issue, and I will provide.

Kind Regards,
Karl

Profiler attachment does not support generic IDocumentStore

I've got my code setup such that the config file determines if it setups an embeddable document store or a standard client connection. It'd be really awesome if this project supported both of those, using the generic IDocumentStore type instead of just the Raven.Client.DocumentStore type.

RavenDb tab empty

Just installed nuget package 1.3, explicitely registered my (embedded) store to glimpse and the ravendb tab definitely stays blank. The glimpse timeline only shows one event "Session created" in the RavenDb category.
I'm using the latest stable RavenDb release (499).

Null value exception when using latest RavenDb (unstable) package

I keep getting "Value cannot be null. Parameter name: httpContext" exceptions, with the following stack trace:
at System.Web.HttpContextWrapper..ctor(HttpContext httpContext)
at Glimpse.Core.Extensibility.GlimpseTimer.get_Context()
at Glimpse.Core.Extensibility.GlimpseTimer.get_TimerMetadata()
at Glimpse.Core.Extensibility.GlimpseTimer.Start(String message, String category, String description)
at Glimpse.RavenDb.Profiler.BeginRequest(Object sender, WebRequestEventArgs e) in C:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 206

Not register raven db requests inside ajax call

Hi
I have installed Glimpse.RavenDb.
I note that RavenDb requests made inside normal page are registered in Glimpse
RavenDb requests made inside ajax call page are not registered in Glimpse.
Have you any idea about this?
Many thanks

Issue with running IDocumentSessions in the background of an ASP.NET

I've been running this plugin on a web app which now runs some tasks in the background via Quartz.Net.

The tasks' dependencies are injected from our IoC container, and one the dependencies is a IDocumentSession.
Since these tasks run in the background there is no http context, and opening a session crashes with the following stack trace:

System.NullReferenceException: Object reference not set to an instance of an object.
at Glimpse.AspNet.AspNetFrameworkProvider.get_HttpRequestStore()
at Glimpse.Core.Framework.Factory.<>c__DisplayClass2.b__1()
at Glimpse.RavenDb.Profiler.PointOnTimeline(String message) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 107
at Glimpse.RavenDb.Profiler.TrackSession(InMemoryDocumentSessionOperations session) in c:\Projects\Glimpse.RavenDb\Glimpse.RavenDb\Profiler.cs:line 86
at Raven.Client.DocumentStoreBase.AfterSessionCreated(InMemoryDocumentSessionOperations session)
at Raven.Client.Document.DocumentStore.AfterSessionCreated(InMemoryDocumentSessionOperations session)
at Raven.Client.Document.DocumentStore.OpenSession(OpenSessionOptions options)
at Raven.Client.Document.DocumentStore.OpenSession()

My expectation would be for glimpse to be "mute" when running outside of an http request, and I'd very much would like to avoid having to set another document store with no profiling just for the background tasks.

Is this a bug? Is there a way to avoid this and keep the profiler set up?

Add support for ShardedDocumentStore

The Profiler.AttachTo interface only accepts a DocumentStore. This means that when using the ShardedDocumentStore it can not be attached to the Glimpse profiler.

(ShardedDocumentStore instances do hold the individual shard instances of the DocumentStore but those aren't initialized and the requests do run through them that way, so that workaround won't work.)

The AttachTo interface should instead take a parameter of the more generic interface of IDocumentStore. That way both ShardedDocumentStore and DocumentStore types will work.

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.