Skip to content

Instantly share code, notes, and snippets.

View kedzior-io's full-sized avatar

Artur Kędzior kedzior-io

View GitHub Profile
@kedzior-io
kedzior-io / SqlClientSleepers
Created October 26, 2022 18:27
SQL Server query for SqlClient Sleepers (Timeout period elapsed obtaining a connection from the pool)
-- From : Michael J Swart (https://sqlperformance.com/2017/07/sql-performance/find-database-connection-leaks)
declare @database_name sysname = N'YOUR_DATABASE_NAME_HERE';
declare @program_name sysname = N'.Net SqlClient Data Provider';
select
datediff(SECOND, s.last_request_end_time, getdate()) as seconds_asleep,
s.last_request_start_time as lastreq,
s.session_id,
db_name(s.database_id) as database_name,
@kedzior-io
kedzior-io / AzureStorageEmulator
Created August 13, 2019 07:29
AzureStorageEmulator
AzureStorageEmulator.exe clear all
AzureStorageEmulator.exe init
AzureStorageEmulator.exe start
@kedzior-io
kedzior-io / timeago.cs
Created December 19, 2018 16:03
Timeago razor helper for asp.net core
// Razor
// -------------------------------------------------------------------
<timeago>@comment.UtcCreatedDateTime</timeago>
// Helper
// -------------------------------------------------------------------
using Microsoft.AspNetCore.Razor.TagHelpers;
using System;
using System.Threading.Tasks;