Skip to content

New branch01 #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions src/Application/src/RazorPagesTestSample/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,13 @@
}
else
{
// Speed loop. Lower this number once every quarter so we
// get our performance improvement quarterly bonus.
for (int i = 0; i < 3000; i++) {
Thread.Sleep(1);
}
// Remove the speed loop for actual performance optimization
// for (int i = 0; i < 3000; i++) {
// await Task.Delay(1);
// }

var wordCount = 0;

foreach (var message in Messages)
{
wordCount += message.Text.Split(' ').Length;
}

var avgWordCount = Decimal.Divide(wordCount, Messages.Count);
var totalWords = Messages.Sum(message => message.Text.Split(' ').Length);

Check failure on line 80 in src/Application/src/RazorPagesTestSample/Pages/Index.cshtml.cs

View workflow job for this annotation

GitHub Actions / build

'IList<Message>' does not contain a definition for 'Sum' and no accessible extension method 'Sum' accepting a first argument of type 'IList<Message>' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 80 in src/Application/src/RazorPagesTestSample/Pages/Index.cshtml.cs

View workflow job for this annotation

GitHub Actions / build

'IList<Message>' does not contain a definition for 'Sum' and no accessible extension method 'Sum' accepting a first argument of type 'IList<Message>' could be found (are you missing a using directive or an assembly reference?)
var avgWordCount = Decimal.Divide(totalWords, Messages.Count);
MessageAnalysisResult = $"The average message length is {avgWordCount:0.##} words.";
}

Expand Down
15 changes: 15 additions & 0 deletions src/InfrastructureAsCode/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ var imageName = 'techexcel/dotnetcoreapp'
var startupCommand = ''


var redisCacheName = '${uniqueString(resourceGroup().id)}-mpnp-redis'

resource redisCache 'Microsoft.Cache/Redis@2021-06-01' = {
name: redisCacheName
location: location
properties: {
sku: {
name: 'Basic'
family: 'C'
capacity: 0
}
enableNonSslPort: false
}
}

resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-12-01-preview' = {
name: logAnalyticsName
location: location
Expand Down
Loading