diff --git a/NzbDrone.Core/Datastore/SqliteProvider.cs b/NzbDrone.Core/Datastore/SqliteProvider.cs deleted file mode 100644 index 1fbe6cf9d..000000000 --- a/NzbDrone.Core/Datastore/SqliteProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using Migrator.Framework; -using Migrator.Providers.SQLite; - -namespace NzbDrone.Core.Datastore -{ - class SqliteProvider - { - private readonly ITransformationProvider _dataBase; - - public SqliteProvider(string connectionString) - { - _dataBase = new SQLiteTransformationProvider(new SQLiteDialect(), connectionString); - } - - - public int GetPageSize() - { - return Convert.ToInt32(_dataBase.ExecuteScalar("PRAGMA cache_size")); - } - - - - } -} diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj index 6b0b1d83a..2dfbc8e39 100644 --- a/NzbDrone.Core/NzbDrone.Core.csproj +++ b/NzbDrone.Core/NzbDrone.Core.csproj @@ -138,9 +138,9 @@ False ..\Libraries\Migrator.NET\Migrator.Providers.dll - + False - ..\packages\MiniProfiler.1.3\lib\MvcMiniProfiler.dll + ..\packages\MiniProfiler.1.4\lib\MvcMiniProfiler.dll ..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll @@ -177,7 +177,6 @@ - diff --git a/NzbDrone.Core/packages.config b/NzbDrone.Core/packages.config index 4668ad886..399a6aebb 100644 --- a/NzbDrone.Core/packages.config +++ b/NzbDrone.Core/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/NzbDrone.Web/NzbDrone.Web.csproj b/NzbDrone.Web/NzbDrone.Web.csproj index cdc7f718a..5e14a3267 100644 --- a/NzbDrone.Web/NzbDrone.Web.csproj +++ b/NzbDrone.Web/NzbDrone.Web.csproj @@ -50,9 +50,9 @@ ..\Libraries\MVC3\Microsoft.Web.Infrastructure.dll True - + False - ..\packages\MiniProfiler.1.3\lib\MvcMiniProfiler.dll + ..\packages\MiniProfiler.1.4\lib\MvcMiniProfiler.dll ..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll diff --git a/NzbDrone.Web/packages.config b/NzbDrone.Web/packages.config index 94f7a8169..00619dcd0 100644 --- a/NzbDrone.Web/packages.config +++ b/NzbDrone.Web/packages.config @@ -7,6 +7,6 @@ - + \ No newline at end of file diff --git a/packages/MiniProfiler.1.3/MiniProfiler.1.3.nupkg b/packages/MiniProfiler.1.3/MiniProfiler.1.3.nupkg deleted file mode 100644 index 3acc489ca..000000000 Binary files a/packages/MiniProfiler.1.3/MiniProfiler.1.3.nupkg and /dev/null differ diff --git a/packages/MiniProfiler.1.3/lib/MvcMiniProfiler.dll b/packages/MiniProfiler.1.3/lib/MvcMiniProfiler.dll deleted file mode 100644 index 5e11c81d0..000000000 Binary files a/packages/MiniProfiler.1.3/lib/MvcMiniProfiler.dll and /dev/null differ diff --git a/packages/MiniProfiler.1.4/MiniProfiler.1.4.nupkg b/packages/MiniProfiler.1.4/MiniProfiler.1.4.nupkg new file mode 100644 index 000000000..dcbc7f48e Binary files /dev/null and b/packages/MiniProfiler.1.4/MiniProfiler.1.4.nupkg differ diff --git a/packages/MiniProfiler.1.4/lib/MvcMiniProfiler.dll b/packages/MiniProfiler.1.4/lib/MvcMiniProfiler.dll new file mode 100644 index 000000000..e35747310 Binary files /dev/null and b/packages/MiniProfiler.1.4/lib/MvcMiniProfiler.dll differ diff --git a/packages/MiniProfiler.1.4/lib/MvcMiniProfiler.pdb b/packages/MiniProfiler.1.4/lib/MvcMiniProfiler.pdb new file mode 100644 index 000000000..2c55ac7d7 Binary files /dev/null and b/packages/MiniProfiler.1.4/lib/MvcMiniProfiler.pdb differ diff --git a/packages/MiniProfiler.1.3/lib/MvcMiniProfiler.xml b/packages/MiniProfiler.1.4/lib/MvcMiniProfiler.xml similarity index 52% rename from packages/MiniProfiler.1.3/lib/MvcMiniProfiler.xml rename to packages/MiniProfiler.1.4/lib/MvcMiniProfiler.xml index 937e4d4cd..3cf07f964 100644 --- a/packages/MiniProfiler.1.3/lib/MvcMiniProfiler.xml +++ b/packages/MiniProfiler.1.4/lib/MvcMiniProfiler.xml @@ -4,278 +4,42 @@ MvcMiniProfiler - + - Categories of sql statements. + Formats any SQL query with inline parameters, optionally including the value type - + - Unknown + Takes a SqlTiming and returns a formatted SQL string, for parameter replacement, etc. - + - DML statements that alter database state, e.g. INSERT, UPDATE + Return SQL the way you want it to look on the in the trace. Usually used to format parameters + + Formatted SQL - + - Statements that return a single record + Creates a new Inline SQL Formatter, optionally including the parameter type info in comments beside the replaced value + whether to include a comment after the value, indicating the type, e.g. /* @myParam DbType.Int32 */ - + - Statements that iterate over a result set + Formats the SQL in a generic frieldly format, including the parameter type information in a comment if it was specified in the InlineFormatter constructor + The SqlTiming to format + A formatted SQL string - + - Extension mechanism for additional services; - - requested service provider or null. - - - - An individual profiling step that can contain child steps. - - - - - Reference to the containing profiler, allowing this Timing to affect the Head and get Stopwatch readings. - - - - - Offset from parent MiniProfiler's creation that this Timing was created. - - - - - Creates a new Timing named 'name' in the 'profiler's session, with 'parent' as this Timing's immediate ancestor. - - - - - Obsolete - used for serialization. - - - - - Adds arbitrary string 'value' under 'key', allowing custom properties to be stored in this Timing step. - - - - - Completes this Timing's duration and sets the MiniProfiler's Head up one level. - - - - - Unique identifer for this timing; set during construction. - - - - - Text displayed when this Timing is rendered. - - - - - How long this Timing step took in ms; includes any Timings' durations. - - - - - The offset from the start of profiling. - - - - - All sub-steps that occur within this Timing step. Add new children through - - - - - Stores arbitrary key/value strings on this Timing step. Add new tuples through . - - - - - Any queries that occurred during this Timing step. - - - - - Which Timing this Timing is under - the duration that this step takes will be added to its parent's duration. - - This will be null for the root (initial) Timing. - - - - Gets the ellapsed milliseconds in this step without any children's durations. - - - - - Gets the aggregate ellapsed milliseconds of all SqlTimings executed in this Timing, excluding Children Timings. - - - - - Returns true when this is less than the configured - , by default 2.0 ms. - - - - - Returns true when this Timing has inner Timing steps. - - - - - Returns true if this Timing step collected sql execution timings. - - - - - Returns true if any s executed in this step are detected as duplicate statements. - - - - - Returns true when this Timing is the first one created in a MiniProfiler session. - - - - - How far away this Timing is from the Profiler's Root. - - - - - How many sql data readers were executed in this Timing step. - - - - - How many sql scalar queries were executed in this Timing step. - - - - - How many sql non-query statements were executed in this Timing step. - - - - - If the underlying command supports BindByName, this sets/clears the underlying - implementation accordingly. This is required to support OracleCommand from dapper-dot-net - - - - - Wraps a database connection, allowing sql execution timings to be collected when a session is started. - - - - - When is not null, returns a new that wraps , - providing query execution profiling. If is null, connection is returned unwrapped. - - Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection - - - - When is not null, returns a new that wraps , - providing query execution profiling. If profiler is null, connection is returned unwrapped. - - Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection - The currently started or null. - - - - Returns a new that wraps , - providing query execution profiling. If profiler is null, no profiling will occur. - - Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection - The currently started or null. - - - - Profiles a single sql execution. - - - - - Creates a new SqlTiming to profile 'command'. - - - - - Obsolete - used for serialization. - - - - - Called when command execution is finished to determine this SqlTiming's duration. - - - - - Called when database reader is closed, ending profiling for SqlTimings. - - - - - To help with display, put some space around sammiched commas - - - - - Category of sql statement executed. - - - - - The sql that was executed. - - - - - Roughly where in the calling code that this sql was executed. - - - - - Offset from main MiniProfiler start that this sql began. - - - - - How long this sql statement took to execute. - - - - - When executing readers, how long it took to come back initially from the database, - before all records are fetched and reader is closed. - - - - - True when other identical sql statements have been executed during this MiniProfiler session. - - - - - Gets part of a stack trace containing only methods we care about. - - - - - Contains the default list of full type names we don't want in any stack trace snippets. + Returns a string representation of the parameter's value, including the type + The parameter to get a value for + @@ -342,13 +106,14 @@ A descriptive name for the code that is encapsulated by the resulting IDisposable's lifetime. This step's visibility level; allows filtering when is called. - + Returns the css and javascript includes needed to display the MiniProfiler results UI. Which side of the page the profiler popup button should be displayed on (defaults to left) Whether to show trivial timings by default (defaults to false) Whether to show time the time with children column by default (defaults to false) + The maximum number of trace popups to show before removing the oldest (defaults to 15) Script and link elements normally; an empty string when there is no active profiling session. @@ -366,6 +131,12 @@ Deserializes the json string parameter to a . + + + Create a DEEP clone of this object + + + Identifies this Profiler so it may be stored/cached. @@ -458,13 +229,11 @@ Various configuration properties. - + - When setters are null, creates default getters and setters that operate on the HttpRuntime.Cache. + Ensures that and objects are initialized. Null values will + be initialized to use the default strategy. - - Our MiniProfiler must have these to run. - @@ -476,9 +245,28 @@ Any Timing step with a duration less than or equal to this will be hidden by default in the UI; defaults to 2.0 ms. - + - Dictates on which side of the page the profiler popup button is displayed; defaults to false (i.e. renders on left side). + Dictates if the "time with children" column is displayed by default, defaults to false. + For a per-page override you can use .RenderIncludes(showTimeWithChildren: true/false) + + + + + Dictates if trivial timings are displayed by default, defaults to false. + For a per-page override you can use .RenderIncludes(showTrivial: true/false) + + + + + Determines how many traces to show before removing the oldest; defaults to 15. + For a per-page override you can use .RenderIncludes(maxTracesToShow: 10) + + + + + Dictates on which side of the page the profiler popup button is displayed; defaults to left. + For a per-page override you can use .RenderIncludes(position: RenderPosition.Left/Right) @@ -488,96 +276,55 @@ Default value is { "/mini-profiler-includes.js", "/mini-profiler-includes.less", "/mini-profiler-results", "/content/", "/scripts/" }. - + - A method that will return a MiniProfiler when given a Guid. Meant for caching individual page profilings for a - very limited time. + The path under which ALL routes are registered in, defaults to the application root. For example, "~/myDirectory/" would yield + "/myDirectory/mini-profiler-includes.js" rather than just "/mini-profiler-includes.js" + Any setting here should be in APP RELATIVE FORM, e.g. "~/myDirectory/" + + + + + Understands how to save and load MiniProfilers for a very limited time. Used for caching between when + a profiling session ends and results can be fetched to the client. - By default, MiniProfilers will be cached for 5 minutes in the HttpRuntime.Cache. This can be extended when the cache is shared - from its top link. + The normal profiling session life-cycle is as follows: + 1) request begins + 2) profiler is started + 3) normal page/controller/request execution + 4) profiler is stopped + 5) profiler is cached with 's implementation of + 6) request ends + 7) page is displayed and profiling results are ajax-fetched down, pulling cached results from + 's implementation of - + - A method that will save a MiniProfiler into a short-duration cache, so results can fetched down to the client after page load. - It is important that you cache the MiniProfiler under its Id, a Guid - this Id will be passed to the ShortTermCacheGetter. + Understands how to save and load MiniProfilers for an extended (even indefinite) time, allowing results to be + shared with other developers or even tracked over time. - - By default, MiniProfilers will be cached for 5 minutes in the HttpRuntime.Cache. - - + - A method that will return a MiniProfiler when given a Guid. Meant for caching profilings for an extended period of time, so - they may be shared with others. + The formatter applied to the SQL being rendered (used only for UI) - - This is used by the full page results view, which is linked in the popup's header. - - - - - A method that will save a MiniProfiler, identified by its Guid Id, into long-term storage. Allows results to be shared with others. - It is important that you cache the MiniProfiler under its Id, a Guid - this Id will be passed to the LongTermCacheGetter. - - - This is activated EVERY TIME the top left header link is clicked in the popup UI and the full page results - view is displayed. When overriding the default, your code will need to handle setting the same profiler - back into your chosen storage medium (e.g. no-op when it already exists). - Assembly version of this dank MiniProfiler. - + - Understands how to route and respond to MiniProfiler UI urls. - - - - - Returns this to handle . - - - - - Returns either includes' css/javascript or results' html. - - - - - Handles rendering our .js and .less static content files. - - - - - Handles rendering a previous MiniProfiler session, identified by its "?id=GUID" on the query. - - - - - Embedded resource contents keyed by filename. - - - - - Helper method that sets a proper 404 response code. - - - - - Try to keep everything static so we can easily be reused. - - - - - This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), - and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** - equality. The type is fully thread-safe. + A function that determines who can access the MiniProfiler results url. It should return true when + the request client has access, false for a 401 to be returned. HttpRequest parameter is the current request and + MiniProfiler parameter is the results that were profiled. + + Both the HttpRequest and MiniProfiler parameters that will be passed into this function should never be null. + @@ -643,5 +390,720 @@ The current profiling session or null. + + + Execute parameterized SQL + + Number of rows affected + + + + Return a list of dynamic objects, reader is closed after the call + + + + + Execute a command that returns multiple result sets, and access each in turn + + + + + Return a typed list of objects, reader is closed after the call + + + + + Maps a query to objects + + The return type + + + + + + + + The Field we should split and read the second object from (default: id) + Number of seconds before command execution timeout + + + + + This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), + and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** + equality. The type is fully thread-safe. + + + + + Read the next grid of results + + + + + This is a micro-cache; suitable when the number of terms is controllable (a few hundred, for example), + and strictly append-only; you cannot change existing values. All key matches are on **REFERENCE** + equality. The type is fully thread-safe. + + + + + Provides saving and loading s to a storage medium. + + + + + Stores under , which is also its . + + + The Guid that identifies the MiniProfiler; subsequent calls to + will pass this Guid. + + The results of a profiling session. + + Should be able to be called multiple times on the same profiler. + + + + + Returns a from storage based on . + + + + + NOT IMPLEMENTED - will format statements with paramters in an Oracle friendly way + + + + + Does NOTHING, implement me! + + + + + Understands how to store a to a MSSQL database. + + + + + Understands how to save MiniProfiler results to a MSSQL database, allowing more permanent storage and + querying of slow results. + + + + + Returns a new SqlServerDatabaseStorage object that will insert into the database identified by connectionString. + + + + + Saves 'profiler' to a database under 'id'. + + + + + Returns the MiniProfiler identified by 'id' from the database or null when no MiniProfiler exists under that 'id'. + + + + + Returns a DbConnection for your specific provider. + + + + + Returns a DbConnection already opened for execution. + + + + + Giving freshly selected collections, this method puts them in the correct + hierarchy under the 'result' MiniProfiler. + + + + + How we connect to the database used to save/load MiniProfiler results. + + + + + Creates needed tables. Run this once on your database. + + + Works in sql server and sqlite (with documented removals). + TODO: add indexes + + + + + Returns a new . + + + + + Stores 'profiler' to dbo.MiniProfilers under 'id'; stores all child Timings and SqlTimings to their respective tables. + + + + + Saves parameter Timing to the dbo.MiniProfilerTimings table. + + + + + Saves parameter SqlTiming to the dbo.MiniProfilerSqlTimings table. + + + + + Saves any SqlTimingParameters used in the profiled SqlTiming to the dbo.MiniProfilerSqlTimingParameters table. + + + + + Loads the MiniProfiler identifed by 'id' from the database. + + + + + Returns a connection to Sql Server. + + + + + An individual profiling step that can contain child steps. + + + + + Rebuilds all the parent timings on deserialization calls + + + + + Offset from parent MiniProfiler's creation that this Timing was created. + + + + + Creates a new Timing named 'name' in the 'profiler's session, with 'parent' as this Timing's immediate ancestor. + + + + + Obsolete - used for serialization. + + + + + Returns this Timing's Name. + + + + + Adds arbitrary string 'value' under 'key', allowing custom properties to be stored in this Timing step. + + + + + Completes this Timing's duration and sets the MiniProfiler's Head up one level. + + + + + Add the parameter 'timing' to this Timing's Children collection. + + + Used outside this assembly for custom deserialization when creating an implementation. + + + + + Adds the parameter 'sqlTiming' to this Timing's SqlTimings collection. + + A sql statement profiling that was executed in this Timing step. + + Used outside this assembly for custom deserialization when creating an implementation. + + + + + Unique identifer for this timing; set during construction. + + + + + Text displayed when this Timing is rendered. + + + + + How long this Timing step took in ms; includes any Timings' durations. + + + + + The offset from the start of profiling. + + + + + All sub-steps that occur within this Timing step. Add new children through + + + + + Stores arbitrary key/value strings on this Timing step. Add new tuples through . + + + + + Any queries that occurred during this Timing step. + + + + + Needed for database deserialization and JSON serialization. + + + + + Which Timing this Timing is under - the duration that this step takes will be added to its parent's duration. + + This will be null for the root (initial) Timing. + + + + Gets the ellapsed milliseconds in this step without any children's durations. + + + + + Gets the aggregate ellapsed milliseconds of all SqlTimings executed in this Timing, excluding Children Timings. + + + + + Returns true when this is less than the configured + , by default 2.0 ms. + + + + + Reference to the containing profiler, allowing this Timing to affect the Head and get Stopwatch readings. + + + + + Returns true when this Timing has inner Timing steps. + + + + + Returns true if this Timing step collected sql execution timings. + + + + + Returns true if any s executed in this step are detected as duplicate statements. + + + + + Returns true when this Timing is the first one created in a MiniProfiler session. + + + + + How far away this Timing is from the Profiler's Root. + + + + + How many sql data readers were executed in this Timing step. + + + + + How many sql scalar queries were executed in this Timing step. + + + + + How many sql non-query statements were executed in this Timing step. + + + + + Categories of sql statements. + + + + + Unknown + + + + + DML statements that alter database state, e.g. INSERT, UPDATE + + + + + Statements that return a single record + + + + + Statements that iterate over a result set + + + + + Contains helper code to time sql statements. + + + + + Returns a new SqlProfiler to be used in the 'profiler' session. + + + + + Tracks when 'command' is started. + + + + + Finishes profiling for 'command', recording durations. + + + + + Called when 'reader' finishes its iterations and is closed. + + + + + The profiling session this SqlProfiler is part of. + + + + + Helper methods that allow operation on SqlProfilers, regardless of their instantiation. + + + + + Tracks when 'command' is started. + + + + + Finishes profiling for 'command', recording durations. + + + + + Called when 'reader' finishes its iterations and is closed. + + + + + Understands how to route and respond to MiniProfiler UI urls. + + + + + Returns this to handle . + + + + + Returns either includes' css/javascript or results' html. + + + + + Handles rendering static content files. + + + + + Handles rendering a previous MiniProfiler session, identified by its "?id=GUID" on the query. + + + + + Embedded resource contents keyed by filename. + + + + + Helper method that sets a proper 404 response code. + + + + + Try to keep everything static so we can easily be reused. + + + + + Formats SQL server queries with a DECLARE up top for parameter values + + + + + Formats the SQL in a SQL-Server friendly way, with DECLARE statements for the parameters up top. + + The SqlTiming to format + A formatted SQL string + + + + Common extension methods to use only in this project + + + + + Answers true if this String is either null or empty. + + + + + Answers true if this String is neither null or empty. + + + + + Removes trailing / characters from a path and leaves just one + + + + + Removes any leading / characters from a path + + + + + Removes any leading / characters from a path + + + + + Extension mechanism for additional services; + + requested service provider or null. + + + + Wraps a database connection, allowing sql execution timings to be collected when a session is started. + + + + + Returns a new that wraps , + providing query execution profiling. + + Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection + + + + Returns a new that wraps , + providing query execution profiling. + + Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection + The currently started or null. + + + + Returns a new that wraps , + providing query execution profiling. If profiler is null, no profiling will occur. + + Your provider-specific flavor of connection, e.g. SqlConnection, OracleConnection + The currently started or null. + + + + Information about a DbParameter used in the sql statement profiled by SqlTiming. + + + + + Which SqlTiming this Parameter was executed with. + + + + + Parameter name, e.g. "@routeName" + + + + + The value submitted to the database. + + + + + System.Data.DbType, e.g. "String", "Bit" + + + + + How large the type is, e.g. for string, size could be 4000 + + + + + Profiles a single sql execution. + + + + + Creates a new SqlTiming to profile 'command'. + + + + + Obsolete - used for serialization. + + + + + Called when command execution is finished to determine this SqlTiming's duration. + + + + + Called when database reader is closed, ending profiling for SqlTimings. + + + + + To help with display, put some space around sammiched commas + + + + + Unique identifier for this SqlTiming. + + + + + Category of sql statement executed. + + + + + The sql that was executed. + + + + + The sql that was executed. + + + + + The command string with special formatting applied based on MiniProfiler.Settings.SqlFormatter + + + + + Roughly where in the calling code that this sql was executed. + + + + + Offset from main MiniProfiler start that this sql began. + + + + + How long this sql statement took to execute. + + + + + When executing readers, how long it took to come back initially from the database, + before all records are fetched and reader is closed. + + + + + Stores any parameter names and values used by the profiled DbCommand. + + + + + Id of the Timing this statement was executed in. + + + Needed for database deserialization. + + + + + The Timing step that this sql execution occurred in. + + + + + True when other identical sql statements have been executed during this MiniProfiler session. + + + + + Gets part of a stack trace containing only methods we care about. + + + + + Contains the default list of full type names we don't want in any stack trace snippets. + + + + + Understands how to store a to the with absolute expiration. + + + + + The string that prefixes all keys that MiniProfilers are saved under, e.g. + "mini-profiler-ecfb0050-7ce8-4bf1-bf82-2cb38e90e31e". + + + + + Returns a new HttpRuntimeCacheStorage class that will cache MiniProfilers for the specified duration. + + + + + Saves to the HttpRuntime.Cache under a key concated with + and . + + + + + Returns the originally-stored + + + + + + + How long to cache each for (i.e. the absolute expiration parameter of + ) + + + + + If the underlying command supports BindByName, this sets/clears the underlying + implementation accordingly. This is required to support OracleCommand from dapper-dot-net + +