Skip to content

Commit d4c829e

Browse files
committed
Uncomment
1 parent 3560d3a commit d4c829e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

samples/documentdb-benchmark/Program.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,26 +140,26 @@ private async Task RunAsync()
140140
// Configure to expire metrics for old clients if not updated for longer than a minute
141141
int defaultTimeToLive = 60;
142142

143-
//if (metricCollection == null)
144-
//{
145-
// Console.WriteLine("Creating metric collection {0}", MetricCollectionName);
146-
// DocumentCollection metricCollectionDefinition = new DocumentCollection();
147-
// metricCollectionDefinition.Id = MetricCollectionName;
148-
// metricCollectionDefinition.DefaultTimeToLive = defaultTimeToLive;
149-
150-
// metricCollection = await ExecuteWithRetries<ResourceResponse<DocumentCollection>>(
151-
// this.client,
152-
// () => client.CreateDocumentCollectionAsync(
153-
// UriFactory.CreateDatabaseUri(DatabaseName),
154-
// new DocumentCollection { Id = MetricCollectionName },
155-
// new RequestOptions { OfferThroughput = 5000 }),
156-
// true);
157-
//}
158-
//else
159-
//{
160-
// metricCollection.DefaultTimeToLive = defaultTimeToLive;
161-
// await client.ReplaceDocumentCollectionAsync(metricCollection);
162-
//}
143+
if (metricCollection == null)
144+
{
145+
Console.WriteLine("Creating metric collection {0}", MetricCollectionName);
146+
DocumentCollection metricCollectionDefinition = new DocumentCollection();
147+
metricCollectionDefinition.Id = MetricCollectionName;
148+
metricCollectionDefinition.DefaultTimeToLive = defaultTimeToLive;
149+
150+
metricCollection = await ExecuteWithRetries<ResourceResponse<DocumentCollection>>(
151+
this.client,
152+
() => client.CreateDocumentCollectionAsync(
153+
UriFactory.CreateDatabaseUri(DatabaseName),
154+
new DocumentCollection { Id = MetricCollectionName },
155+
new RequestOptions { OfferThroughput = 5000 }),
156+
true);
157+
}
158+
else
159+
{
160+
metricCollection.DefaultTimeToLive = defaultTimeToLive;
161+
await client.ReplaceDocumentCollectionAsync(metricCollection);
162+
}
163163

164164
Console.WriteLine("Starting Inserts with {0} tasks", TaskCount);
165165
string sampleDocument = File.ReadAllText(ConfigurationManager.AppSettings["DocumentTemplateFile"]);
@@ -264,7 +264,7 @@ private async Task LogOutputStats()
264264
latestStats["requestUnitsPerMonthBasedOnLastSecond"] =
265265
Math.Round(((requestUnits - lastRequestUnits) / (seconds - lastSeconds)) * 86400 * 30);
266266

267-
//await InsertMetricsToDocumentDB(latestStats);
267+
await InsertMetricsToDocumentDB(latestStats);
268268

269269
lastCount = documentsInserted;
270270
lastSeconds = seconds;

0 commit comments

Comments
 (0)