<commit_before>import _ from 'lodash';
import moment from 'moment';
import TableModel from 'grafana/app/core/table_model';
import * as utils from '../datasource-zabbix/utils';
import * as c from './constants';
import { DataFrame, Field, FieldType, ArrayVector } from '@grafana/data';
import { ZBXProblem, ZBXTrigger, ProblemDTO } from './types';

export function joinTriggersWithProblems(problems: ZBXProblem[], triggers: ZBXTrigger[]): ProblemDTO[] {
  const problemDTOList: ProblemDTO[] = [];
  for (let i = 0; i < problems.length; i++) {
    const p = problems[i];
    const triggerId = Number(p.objectid);
    const t = triggers[triggerId];
    const problemDTO: ProblemDTO = {
      timestamp: Number(p.clock),
      triggerid: p.objectid,
      eventid: p.eventid,
      name: p.name,
      severity: p.severity,
      acknowledged: p.acknowledged,
      acknowledges: p.acknowledges,
      tags: p.tags,
      suppressed: p.suppressed,
      suppression_data: p.suppression_data,
      description: t.description,
      comments: t.comments,
      value: t.value,
      groups: t.groups,
      hosts: t.hosts,
      items: t.items,
      alerts: t.alerts,
      url: t.url,
      expression: t.expression,
      correlation_mode: t.correlation_mode,
      correlation_tag: t.correlation_tag,<commit_msg>Chore: remove unused imports<commit_after>import _ from 'lodash';
import * as utils from '../datasource-zabbix/utils';
import { DataFrame, Field, FieldType, ArrayVector } from '@grafana/data';
import { ZBXProblem, ZBXTrigger, ProblemDTO } from './types';

export function joinTriggersWithProblems(problems: ZBXProblem[], triggers: ZBXTrigger[]): ProblemDTO[] {
  const problemDTOList: ProblemDTO[] = [];
  for (let i = 0; i < problems.length; i++) {
    const p = problems[i];
    const triggerId = Number(p.objectid);
    const t = triggers[triggerId];
    const problemDTO: ProblemDTO = {
      timestamp: Number(p.clock),
      triggerid: p.objectid,
      eventid: p.eventid,
      name: p.name,
      severity: p.severity,
      acknowledged: p.acknowledged,
      acknowledges: p.acknowledges,
      tags: p.tags,
      suppressed: p.suppressed,
      suppression_data: p.suppression_data,
      description: t.description,
      comments: t.comments,
      value: t.value,
      groups: t.groups,
      hosts: t.hosts,
      items: t.items,
      alerts: t.alerts,
      url: t.url,
      expression: t.expression,
      correlation_mode: t.correlation_mode,
      correlation_tag: t.correlation_tag,
{'fraction_non_alphanumeric': 0.12157330154946365, 'fraction_numerical': 0.0007945967421533572, 'mean_word_length': 3.2319327731092438, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '119036', 'n_tokens_mistral': 820, 'n_tokens_neox': 806, 'n_words': 199}