mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	add count to app state
This commit is contained in:
		
							parent
							
								
									c7faf46d26
								
							
						
					
					
						commit
						7460326c5d
					
				@ -78,6 +78,7 @@ test('addPayload', t => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    t.truthy(metrics.clients[instanceId].appName === appName);
 | 
					    t.truthy(metrics.clients[instanceId].appName === appName);
 | 
				
			||||||
    t.truthy(metrics.clients[instanceId].count === 123);
 | 
					    t.truthy(metrics.clients[instanceId].count === 123);
 | 
				
			||||||
 | 
					    t.truthy(metrics.apps[appName].count === 123);
 | 
				
			||||||
    t.truthy(metrics.globalCount === 123);
 | 
					    t.truthy(metrics.globalCount === 123);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    t.deepEqual(metrics.getTogglesMetrics().lastHour.toggleX, { yes: 123, no: 0 });
 | 
					    t.deepEqual(metrics.getTogglesMetrics().lastHour.toggleX, { yes: 123, no: 0 });
 | 
				
			||||||
 | 
				
			|||||||
@ -81,6 +81,9 @@ module.exports = class UnleashClientMetrics {
 | 
				
			|||||||
            if (this.clients[instanceId]) {
 | 
					            if (this.clients[instanceId]) {
 | 
				
			||||||
                this.clients[instanceId].count += count;
 | 
					                this.clients[instanceId].count += count;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            if (this.apps[appName]) {
 | 
				
			||||||
 | 
					                this.apps[appName].count += count;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user