Skip to content
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

Homework 6 #6

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Homework 6 #6

wants to merge 20 commits into from

Conversation

Iamflip
Copy link
Owner

@Iamflip Iamflip commented Apr 11, 2021

No description provided.

{
using (var connection = new SQLiteConnection(ConnectionString))
{
return connection.QuerySingle<CpuMetric>("SELECT * FROM cpumetrics ORDER BY id DESC LIMIT 1");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На пустой базе запрос будет падать.

{
using (var connection = new SQLiteConnection(ConnectionString))
{
return connection.QuerySingle<CpuMetric>("SELECT * FROM cpumetrics ORDER BY id DESC LIMIT 1");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На пустой базе запрос падает. Разумеется метрики не собираются

public Task Execute(IJobExecutionContext context)
{
IList<AgentInfo> agents = _agentRepository.GetAll();
var last = _UNIX.AddSeconds(_metricRepository.GetLast().Time.TotalSeconds);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

опять эта ненужная константа _UNIX. Выпилить ее везде и переписать с использованием существующих методов Net Cor (DateTimeOffset.UnixEpoch)


for (int i = 0; i < agents.Count; i++)
{
var temp = new GetAllCpuMetricsApiRequest();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temp это что такое? температура? Я уже и на лекциях и в ревью много раз замечал что именования очень важны. Назовите нормально, пожалуйста, исходя из того что за сущность вы тут создаете

public Task Execute(IJobExecutionContext context)
{
IList<AgentInfo> agents = _agentRepository.GetAll();
var last = _UNIX.AddSeconds(_metricRepository.GetLast().Time.TotalSeconds);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это работать не будет. Last надо получать не вообще, а для каждого агента СВОЙ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants