-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #226 from Blazam-App/Beta-Dev
Fix application memory measurement, add CPU usage measuring
- Loading branch information
Showing
4,144 changed files
with
480 additions
and
196 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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,145 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<ServerGarbageCollection>false</ServerGarbageCollection> | ||
<AssemblyVersion>0.8.8</AssemblyVersion> | ||
<Version>2024.02.13.2207</Version> | ||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion> | ||
<RootNamespace>BLAZAM</RootNamespace> | ||
<GenerateDocumentationFile>False</GenerateDocumentationFile> | ||
|
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="Exceptions\**" /> | ||
<Content Remove="Exceptions\**" /> | ||
<EmbeddedResource Remove="Exceptions\**" /> | ||
<None Remove="Exceptions\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="nssm.exe" /> | ||
<None Remove="static\img\default_logo.png" /> | ||
<None Remove="static\img\default_logo2.png" /> | ||
<None Remove="static\img\default_logo3.png" /> | ||
<None Remove="static\img\default_logo4.png" /> | ||
</ItemGroup> | ||
|
||
|
||
|
||
|
||
|
||
<ItemGroup> | ||
<Content Include="nssm.exe"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="static\img\default_logo.png"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="static\img\default_logo2.png"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="static\img\default_logo3.png"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="static\img\default_logo4.png"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BlazorTemplater" Version="1.5.1" /> | ||
<PackageReference Include="Cassia" Version="2.0.0.60" /> | ||
<PackageReference Include="Core.System.Configuration.Install" Version="1.1.0" /> | ||
<PackageReference Include="DuoUniversal" Version="1.2.1" /> | ||
<PackageReference Include="MailKit" Version="4.3.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.26" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="6.0.26" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.26" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.26" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.15" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.15" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.15" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.15" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.15" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.15"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.1" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.EventLog" Version="8.0.0" /> | ||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.16" /> | ||
<PackageReference Include="MudBlazor.Markdown" Version="0.1.3" /> | ||
<PackageReference Include="MudBlazor.ThemeManager" Version="1.0.8" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||
<PackageReference Include="Octokit" Version="9.1.2" /> | ||
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" /> | ||
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" /> | ||
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.1.0" /> | ||
<PackageReference Include="System.DirectoryServices" Version="8.0.0" /> | ||
|
||
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\BLAZAMActiveDirectory\BLAZAMActiveDirectory.csproj" /> | ||
<ProjectReference Include="..\BLAZAMCommon\BLAZAMCommon.csproj" /> | ||
<ProjectReference Include="..\BLAZAMDatabase\BLAZAMDatabase.csproj" /> | ||
<ProjectReference Include="..\BLAZAMEmailMessage\BLAZAMEmailMessage.csproj" /> | ||
<ProjectReference Include="..\BLAZAMEmail\BLAZAMEmail.csproj" /> | ||
<ProjectReference Include="..\BLAZAMFileSystem\BLAZAMFileSystem.csproj" /> | ||
<ProjectReference Include="..\BLAZAMGui\BLAZAMGui.csproj" /> | ||
<ProjectReference Include="..\BLAZAMJobs\BLAZAMJobs.csproj" /> | ||
<ProjectReference Include="..\BLAZAMLocalization\BLAZAMLocalization.csproj" /> | ||
<ProjectReference Include="..\BLAZAMLoggers\BLAZAMLogger.csproj" /> | ||
<ProjectReference Include="..\BLAZAMNav\BLAZAMNav.csproj" /> | ||
<ProjectReference Include="..\BLAZAMNotifications\BLAZAMNotifications.csproj" /> | ||
<ProjectReference Include="..\BLAZAMServices\BLAZAMServices.csproj" /> | ||
<ProjectReference Include="..\BLAZAMSession\BLAZAMSession.csproj" /> | ||
<ProjectReference Include="..\BLAZAMStatic\BLAZAMStatic.csproj" /> | ||
<ProjectReference Include="..\BlazamUpdate\BLAZAMUpdate.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="Properties\Resources.Designer.cs"> | ||
<DesignTime>True</DesignTime> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Resources.resx</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Update="appsettings.json"> | ||
<CopyToOutputDirectory>Never</CopyToOutputDirectory> | ||
</Content> | ||
<Content Update="wwwroot\favicon.ico"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Update="Properties\Resources.resx"> | ||
<Generator>ResXFileCodeGenerator</Generator> | ||
<LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="license.rtf"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="updater\update.ps1"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> | ||
<Exec Condition="'$(Configuration)' == 'Debug'" Command="powershell -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\IncrementBuildNumber.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" /> | ||
</Target> | ||
</Project> |
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
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
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
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
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
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
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
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
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
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,73 @@ | ||
@inherits AppComponentBase | ||
@using System.Diagnostics | ||
<SettingsField Label=@AppLocalization["CPU"]> | ||
@if (CPUCounter != null) | ||
{ | ||
<MudText>@cpuUsage%</MudText> | ||
} | ||
else | ||
{ | ||
<MudText>@AppLocalization["Loading"]</MudText> | ||
} | ||
|
||
</SettingsField> | ||
<SettingsField Label=@AppLocalization["Memory"]> | ||
@if (MemoryCounter != null) | ||
{ | ||
<MudText>@memoryUsage</MudText> | ||
|
||
} | ||
else | ||
{ | ||
<MudText>@AppLocalization["Loading"]</MudText> | ||
} | ||
</SettingsField> | ||
|
||
@code { | ||
[Parameter] | ||
public Process Process { get; set; } | ||
|
||
private string cpuUsage | ||
{ | ||
get | ||
|
||
{ | ||
return Math.Round(CPUCounter.NextValue(),2).ToString(); | ||
Process.Refresh(); | ||
return Process.TotalProcessorTime.ToString(); | ||
|
||
} | ||
} | ||
private string memoryUsage | ||
{ | ||
get | ||
|
||
{ | ||
return new ByteSize(MemoryCounter.NextValue()).ToString(); | ||
|
||
|
||
} | ||
} | ||
private PerformanceCounter? CPUCounter; | ||
private PerformanceCounter? MemoryCounter; | ||
|
||
private Timer? refreshTimer; | ||
protected override async Task OnInitializedAsync() | ||
{ | ||
await base.OnInitializedAsync(); | ||
refreshTimer = new Timer((state) => { InvokeAsync(StateHasChanged); }, null, 2000, 2000); | ||
await Task.Run(() => | ||
{ | ||
CPUCounter = new PerformanceCounter("Process", "% Processor Time", | ||
Process.ProcessName); | ||
MemoryCounter = new PerformanceCounter("Process", "Working Set", | ||
Process.ProcessName); | ||
|
||
}); | ||
|
||
} | ||
public override void Dispose() | ||
{ | ||
refreshTimer?.Dispose(); | ||
} | ||
} |
Oops, something went wrong.