Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Show Query Metrics per partition * Better memory management * Start the application maximized * Handle exceptions on CollectionMetrics not loading correctly * Renamed project folder * Index editor (#17) * Add UI Editor for Indexing Policy * Execute storeproc (#18) Fix #5 Execute Stored Procedure * Fix issue with new Asset Node creating in multiple collection * Fix issue with Reset Query Options * Add more information to Metrics * Close Tab when deleting on the treeview
- Loading branch information
1 parent
1609d60
commit ec81606
Showing
185 changed files
with
2,717 additions
and
702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
162 changes: 143 additions & 19 deletions
162
src/DocumentDbExplorer/App.xaml → src/CosmosDbExplorer/App.xaml
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
src/CosmosDbExplorer/Infrastructure/Converters/QueryMetricsToDocumentConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using ICSharpCode.AvalonEdit.Document; | ||
using Microsoft.Azure.Documents; | ||
|
||
namespace CosmosDbExplorer.Infrastructure.Converters | ||
{ | ||
public class QueryMetricsToDocumentConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is QueryMetrics metrics) | ||
{ | ||
return new TextDocument(metrics.ToString()); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/CosmosDbExplorer/Infrastructure/Converters/QueryMetricsToStringConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using Microsoft.Azure.Documents; | ||
|
||
namespace CosmosDbExplorer.Infrastructure.Converters | ||
{ | ||
public class QueryMetricsToStringConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (value is QueryMetrics metrics) | ||
{ | ||
return metrics.ToString(); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
50 changes: 50 additions & 0 deletions
50
src/CosmosDbExplorer/Infrastructure/Models/CollectionMetrics.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.Azure.Documents; | ||
using Microsoft.Azure.Documents.Client; | ||
|
||
namespace CosmosDbExplorer.Infrastructure.Models | ||
{ | ||
public class CollectionMetric | ||
{ | ||
public CollectionMetric(ResourceResponse<DocumentCollection> documentCollection) | ||
{ | ||
var quotaUsage = documentCollection.CurrentResourceQuotaUsage | ||
.Split(';') | ||
.Select(item => new { Key = item.Split('=')[0], Value = item.Split('=')[1] }) | ||
.ToDictionary(d => d.Key, d => d.Value); | ||
|
||
RequestCharge = documentCollection.RequestCharge; | ||
PartitionCount = documentCollection.Resource.PartitionKeyRangeStatistics.Count; | ||
DocumentSize = long.Parse(quotaUsage["documentsSize"]); | ||
DocumentCount = long.Parse(quotaUsage["documentsCount"]); | ||
PartitionMetrics = documentCollection.Resource.PartitionKeyRangeStatistics.ToList(); | ||
CollectionSizeQuota = documentCollection.CollectionSizeQuota; | ||
CollectionSizeUsage = documentCollection.CollectionSizeUsage; | ||
StoredProceduresQuota = documentCollection.StoredProceduresQuota; | ||
StoredProceduresUsage = documentCollection.StoredProceduresUsage; | ||
TriggersQuota = documentCollection.TriggersQuota; | ||
TriggersUsage = documentCollection.TriggersUsage; | ||
UserDefinedFunctionsQuota = documentCollection.UserDefinedFunctionsQuota; | ||
UserDefinedFunctionsUsage = documentCollection.UserDefinedFunctionsUsage; | ||
} | ||
|
||
public double RequestCharge { get; } | ||
public int PartitionCount { get; } | ||
public long DocumentCount { get; } | ||
public long DocumentSize { get; } | ||
public List<PartitionKeyRangeStatistics> PartitionMetrics { get; } | ||
public long CollectionSizeQuota { get; } | ||
public long CollectionSizeUsage { get; } | ||
public long StoredProceduresQuota { get; } | ||
public long StoredProceduresUsage { get; } | ||
public long TriggersQuota { get; } | ||
public long TriggersUsage { get; } | ||
public long UserDefinedFunctionsQuota { get; } | ||
public long UserDefinedFunctionsUsage { get; } | ||
public bool HasPartitionKey { get; } | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.