• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / deck.gl / 10533668922

23 Aug 2024 11:27PM UTC coverage: 89.293% (+0.4%) from 88.902%
10533668922

push

github

web-flow
GPU Aggregation (7/8): ContourLayer (#9099)

6755 of 7391 branches covered (91.39%)

Branch coverage included in aggregate %.

522 of 533 new or added lines in 6 files covered. (97.94%)

13 existing lines in 2 files now uncovered.

56179 of 63089 relevant lines covered (89.05%)

13893.01 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.44
/modules/core/src/debug/loggers.ts
1
import type {Log} from '@probe.gl/log';
1✔
2

1✔
3
const logState: {
1✔
4
  attributeUpdateStart: number;
1✔
5
  attributeManagerUpdateStart: number;
1✔
6
  attributeUpdateMessages: string[];
1✔
7
} = {
1✔
8
  attributeUpdateStart: -1,
1✔
9
  attributeManagerUpdateStart: -1,
1✔
10
  attributeUpdateMessages: []
1✔
11
};
1✔
12

1✔
13
const LOG_LEVEL_MAJOR_UPDATE = 1; // Events with direct perf impact
1✔
14
const LOG_LEVEL_MINOR_UPDATE = 2; // Events that may affect perf
1✔
15
const LOG_LEVEL_UPDATE_DETAIL = 3;
1✔
16
const LOG_LEVEL_INFO = 4;
1✔
17
const LOG_LEVEL_DRAW = 2;
1✔
18

1✔
19
export const getLoggers = (log: Log): Record<string, Function> => ({
1✔
20
  /* Layer events */
1✔
21

1✔
22
  'layer.changeFlag': (layer, key, flags) => {
1✔
23
    log.log(LOG_LEVEL_UPDATE_DETAIL, `${layer.id} ${key}: `, flags[key])();
5✔
24
  },
5✔
25

1✔
26
  'layer.initialize': layer => {
1✔
27
    log.log(LOG_LEVEL_MAJOR_UPDATE, `Initializing ${layer}`)();
1✔
28
  },
1✔
29
  'layer.update': (layer, needsUpdate) => {
1✔
30
    if (needsUpdate) {
2✔
31
      const flags = layer.getChangeFlags();
1✔
32
      log.log(
1✔
33
        LOG_LEVEL_MINOR_UPDATE,
1✔
34
        `Updating ${layer} because: ${Object.keys(flags)
1✔
35
          .filter(key => flags[key])
1✔
36
          .join(', ')}`
1✔
37
      )();
1✔
38
    } else {
1✔
39
      log.log(LOG_LEVEL_INFO, `${layer} does not need update`)();
1✔
40
    }
1✔
41
  },
2✔
42
  'layer.matched': (layer, changed) => {
1✔
UNCOV
43
    if (changed) {
×
UNCOV
44
      log.log(LOG_LEVEL_INFO, `Matched ${layer}, state transfered`)();
×
UNCOV
45
    }
×
UNCOV
46
  },
×
47
  'layer.finalize': layer => {
1✔
48
    log.log(LOG_LEVEL_MAJOR_UPDATE, `Finalizing ${layer}`)();
1✔
49
  },
1✔
50

1✔
51
  /* CompositeLayer events */
1✔
52

1✔
53
  'compositeLayer.renderLayers': (layer, updated, subLayers) => {
1✔
UNCOV
54
    if (updated) {
×
UNCOV
55
      log.log(
×
UNCOV
56
        LOG_LEVEL_MINOR_UPDATE,
×
UNCOV
57
        `Composite layer rendered new subLayers ${layer}`,
×
UNCOV
58
        subLayers
×
UNCOV
59
      )();
×
UNCOV
60
    } else {
×
61
      log.log(LOG_LEVEL_INFO, `Composite layer reused subLayers ${layer}`, subLayers)();
×
62
    }
×
UNCOV
63
  },
×
64

1✔
65
  /* LayerManager events */
1✔
66

1✔
67
  'layerManager.setLayers': (layerManager, updated, layers) => {
1✔
68
    if (updated) {
3✔
69
      log.log(LOG_LEVEL_MINOR_UPDATE, `Updating ${layers.length} deck layers`)();
3✔
70
    }
3✔
71
  },
3✔
72

1✔
73
  'layerManager.activateViewport': (layerManager, viewport) => {
1✔
74
    log.log(LOG_LEVEL_UPDATE_DETAIL, 'Viewport changed', viewport)();
13✔
75
  },
13✔
76

1✔
77
  /* AttributeManager events */
1✔
78

1✔
79
  'attributeManager.invalidate': (attributeManager, trigger, attributeNames) => {
1✔
80
    log.log(
7✔
81
      LOG_LEVEL_MAJOR_UPDATE,
7✔
82
      attributeNames
7✔
83
        ? `invalidated attributes ${attributeNames} (${trigger}) for ${attributeManager.id}`
4✔
84
        : `invalidated all attributes for ${attributeManager.id}`
3✔
85
    )();
7✔
86
  },
7✔
87

1✔
88
  'attributeManager.updateStart': attributeManager => {
1✔
89
    logState.attributeUpdateMessages.length = 0;
14✔
90
    logState.attributeManagerUpdateStart = Date.now();
14✔
91
  },
14✔
92
  'attributeManager.updateEnd': (attributeManager, numInstances) => {
1✔
93
    const timeMs = Math.round(Date.now() - logState.attributeManagerUpdateStart);
10✔
94
    log.groupCollapsed(
10✔
95
      LOG_LEVEL_MINOR_UPDATE,
10✔
96
      `Updated attributes for ${numInstances} instances in ${attributeManager.id} in ${timeMs}ms`
10✔
97
    )();
10✔
98
    for (const updateMessage of logState.attributeUpdateMessages) {
10✔
99
      log.log(LOG_LEVEL_UPDATE_DETAIL, updateMessage)();
23✔
100
    }
23✔
101
    log.groupEnd(LOG_LEVEL_MINOR_UPDATE)();
10✔
102
  },
10✔
103

1✔
104
  /* Attribute events */
1✔
105

1✔
106
  'attribute.updateStart': attribute => {
1✔
107
    logState.attributeUpdateStart = Date.now();
13✔
108
  },
13✔
109
  'attribute.allocate': (attribute, numInstances) => {
1✔
110
    const message = `${attribute.id} allocated ${numInstances}`;
11✔
111
    logState.attributeUpdateMessages.push(message);
11✔
112
  },
11✔
113
  'attribute.updateEnd': (attribute, numInstances) => {
1✔
114
    const timeMs = Math.round(Date.now() - logState.attributeUpdateStart);
12✔
115
    const message = `${attribute.id} updated ${numInstances} in ${timeMs}ms`;
12✔
116
    logState.attributeUpdateMessages.push(message);
12✔
117
  },
12✔
118

1✔
119
  /* Render events */
1✔
120

1✔
121
  'deckRenderer.renderLayers': (deckRenderer, renderStats, opts) => {
1✔
122
    const {pass, redrawReason, stats} = opts;
2✔
123
    for (const status of renderStats) {
2✔
124
      const {totalCount, visibleCount, compositeCount, pickableCount} = status;
2✔
125
      const primitiveCount = totalCount - compositeCount;
2✔
126
      const hiddenCount = primitiveCount - visibleCount;
2✔
127

2✔
128
      log.log(
2✔
129
        LOG_LEVEL_DRAW,
2✔
130
        `RENDER #${deckRenderer.renderCount} \
2✔
131
  ${visibleCount} (of ${totalCount} layers) to ${pass} because ${redrawReason} \
2✔
132
  (${hiddenCount} hidden, ${compositeCount} composite ${pickableCount} pickable)`
2✔
133
      )();
2✔
134

2✔
135
      if (stats) {
2!
136
        stats.get('Redraw Layers').add(visibleCount);
×
137
      }
×
138
    }
2✔
139
  }
2✔
140
});
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc