Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/renerick/miniprofiler.litedb
A simple wrapper for profiling LiteDB database with MiniProfiler
https://github.com/renerick/miniprofiler.litedb
Last synced: 28 days ago
JSON representation
A simple wrapper for profiling LiteDB database with MiniProfiler
- Host: GitHub
- URL: https://github.com/renerick/miniprofiler.litedb
- Owner: Renerick
- License: mit
- Created: 2022-06-11T14:55:37.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-07T08:44:59.000Z (over 2 years ago)
- Last Synced: 2024-10-14T19:42:37.558Z (2 months ago)
- Language: C#
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MiniProfiler.LiteDB
[![Nuget](https://img.shields.io/nuget/v/Contrib.MiniProfiler.LiteDB?logo=nuget&style=flat-square)](https://www.nuget.org/packages/Contrib.MiniProfiler.LiteDB/)
A simple wrapper for profiling LiteDB database with MiniProfiler.
## How it works
This package implements `ProfiledLiteEngine` wrapper for `LiteEngine` class.
The wrapper measures [custom timings](https://miniprofiler.com/dotnet/HowTo/ProfileCode)
in all methods that query or modify data in LiteDB database.The results look like this
| ![Profile result](https://raw.githubusercontent.com/Renerick/MiniProfiler.LiteDB/master/imgs/profile-result.png) | ![Query details](https://raw.githubusercontent.com/Renerick/MiniProfiler.LiteDB/master/imgs/query-details.png) |
|------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------|## How to use
You can simply substitute `new LiteDatabase()` constructor calls with `ProfiledLiteDatabaseFactory.New()` calls.
This factory method has matching overloads, with the exception of mandatory `profiler` parameter.Under the hood, this method creates `LiteDatabase` instance with profiled engine instance.
```csharp
var database = ProfiledLiteDatabaseFactory.New(ConnectionString, MiniProfiler.Current);
```Alternatively, create `ProfiledLiteEngine` and pass it to `LiteDatabase` manually.
```csharp
var database = new LiteDatabase(
new ProfiledLiteEngine(new SharedEngine(settings), MiniProfiler.Current)
);
```## License
This packages is distributed under the [MIT License](https://github.com/Renerick/MiniProfiler.LiteDB/blob/master/LICENSE.md)
---
[LiteDB](https://github.com/mbdavid/LiteDB) is licensed under the [MIT license](https://github.com/mbdavid/LiteDB/blob/master/LICENSE). Credits: [Mauricio David](https://github.com/mbdavid)
[MiniProfiler](https://github.com/MiniProfiler/dotnet) is licensed under the [MIT license](https://github.com/MiniProfiler/dotnet/blob/main/LICENSE.txt). Credits: .NET MiniProfiler Contributors