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

visgl / deck.gl / 21559132194

01 Feb 2026 07:47AM UTC coverage: 91.089% (-0.02%) from 91.106%
21559132194

push

github

web-flow
feat(basemap-browser): add batched rendering toggle and multi-view examples (#9946)

6862 of 7541 branches covered (91.0%)

Branch coverage included in aggregate %.

56815 of 62365 relevant lines covered (91.1%)

14386.72 hits per line

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

89.7
/modules/core/src/debug/loggers.ts
1
// deck.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
import type {Log} from '@probe.gl/log';
1✔
6

1✔
7
const logState: {
1✔
8
  attributeUpdateStart: number;
1✔
9
  attributeManagerUpdateStart: number;
1✔
10
  attributeUpdateMessages: string[];
1✔
11
} = {
1✔
12
  attributeUpdateStart: -1,
1✔
13
  attributeManagerUpdateStart: -1,
1✔
14
  attributeUpdateMessages: []
1✔
15
};
1✔
16

1✔
17
const LOG_LEVEL_MAJOR_UPDATE = 1; // Events with direct perf impact
1✔
18
const LOG_LEVEL_MINOR_UPDATE = 2; // Events that may affect perf
1✔
19
const LOG_LEVEL_UPDATE_DETAIL = 3;
1✔
20
const LOG_LEVEL_INFO = 4;
1✔
21
const LOG_LEVEL_DRAW = 2;
1✔
22

1✔
23
export const getLoggers = (log: Log): Record<string, Function> => ({
1✔
24
  /* Layer events */
1✔
25

1✔
26
  'layer.changeFlag': (layer, key, flags) => {
1✔
27
    log.log(LOG_LEVEL_UPDATE_DETAIL, `${layer.id} ${key}: `, flags[key])();
5✔
28
  },
5✔
29

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

1✔
55
  /* CompositeLayer events */
1✔
56

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

1✔
69
  /* LayerManager events */
1✔
70

1✔
71
  'layerManager.setLayers': (layerManager, updated, layers) => {
1✔
72
    if (updated) {
3✔
73
      log.log(LOG_LEVEL_MINOR_UPDATE, `Updating ${layers.length} deck layers`)();
3✔
74
    }
3✔
75
  },
3✔
76

1✔
77
  'layerManager.activateViewport': (layerManager, viewport) => {
1✔
78
    log.log(LOG_LEVEL_UPDATE_DETAIL, 'Viewport changed', viewport)();
13✔
79
  },
13✔
80

1✔
81
  /* AttributeManager events */
1✔
82

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

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

1✔
108
  /* Attribute events */
1✔
109

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

1✔
123
  /* Render events */
1✔
124

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

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

2✔
139
      if (stats) {
2!
140
        stats.get('Redraw Layers').add(visibleCount);
×
141
      }
×
142
    }
2✔
143
  }
2✔
144
});
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