Documentation

Welcome to the Glimpse Documentation! Here we hope to introduce you to the various tutorials, concepts and APIs you might need when discovering and using Glimpse.

NOTE: Glimpse docs are currently being improved. If you'd like to help out, just edit this page or contribute to our GitHub Wiki

Platform Concepts

Glimpse has the required abstractions which means that is not tied to any one platform. This means that as a framework that doesn't run on under System.Web, to get Glimpse running, all you need to do is implement several different providers to get Glimpse running on your platform.

Platform Hooks

For Glimpse to operate on a different platform we assume that every web platform has the following programmable concepts:

  • Resource Endpoints
    • In the end, only a single endpoint is required. Glimpse providers the internal plumbing to be able to serve many assets via this open endpoint. For interest sake, examples of the different assets that might be served can be found here.
    • Under System.Web on the ASP.NET stack, this would be a System.Web.IHttpHandler.
  • Request Listeners
    • As Glimpse is collecting information about a given request, we need to know about when a request starts and finishes, and if your framework supports session, when session access starts and finishes.
    • Under System.Web on the ASP.NET stack, this would be a System.Web.IHttpModule.

Example implementations for these concepts under System.Web and how they interact with the Glimpse runtime can be found here:

Framework Provider

Additionally, we need to able able to access various request context details/providers/assets:

  • Http Request Store
    • A request store is a place for Glimpse to store data that lives and dies with an Http request. In ASP.NET, HttpContext.Items is a request store.
      • Http Server Store
    • A server store is a place for Glimpse to store data a persists across Http requests. In ASP.NET, HttpContext.Application is a server store.
  • Runtime Context
    • Instance of the underlying context that the web development framework uses. In ASP.NET, HttpContext is the runtime context.
  • Request Metadata
    • An instance of IRequestMetadata which provides relevant metadata about an Http request. In ASP.NET, a HttpRequest contains must data required for creating a IRequestMetadata.
  • Set HttpResponse Header
  • Set Http Response Status Code
  • Set Cookie
  • Inject Http Response Body
    • Injects the Http response body. Inserts the given html snippet into the html document just before the end </body> tag.
  • Write Http Response
    • Writes the Http response. Used by the resource infrastructure (mentioned above) to output binary content (i.e. embedded content, images, etc).
  • Write Http Response
    • Writes the Http response. Used by the resource infrastructure to output string content (i.e. generated strings, JSON objects, etc).

The formal definition for the Framework Provider can be found here:

Example implementations for these concepts under System.Web and how they interact with the Glimpse runtime can be found here:

Request Metadata

Lastly, within a given request, we need to access the properties that describe the metadata associated with a request:

  • Request Uri
  • Request Http Method
  • Response Status Code
  • Response Content Type
  • Ip Address
  • Request Is Ajax
  • Client Id
  • Get Cookie
  • Get Http Header

The formal definition for the Request Metadata can be found here:

Example implementations for these concepts under System.Web and how they interact with the Glimpse runtime can be found here: