Fix formatting issue Payload struct comment.
This commit is contained in:
		
							parent
							
								
									dbb8319752
								
							
						
					
					
						commit
						c258047412
					
				
					 1 changed files with 17 additions and 15 deletions
				
			
		
							
								
								
									
										32
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										32
									
								
								main.go
									
										
									
									
									
								
							|  | @ -27,27 +27,29 @@ import ( | |||
| // | ||||
| // Gas consumption is updated once per minute. | ||||
| // Not saving intermittent values theoretically saves 4 bytes per value. | ||||
| //   Storage for non-NULL values every second: | ||||
| //     86,400 entries/day×4 bytes/entry=345,600 bytes/day86,400entries/day×4bytes/entry=345,600bytes/day | ||||
| //   Storage for non-NULL values every minute: | ||||
| //     1,440 entries/day×4 bytes/entry=5,760 bytes/day1,440entries/day×4bytes/entry=5,760bytes/day | ||||
| //   Storage savings: | ||||
| //     345,600 bytes/day−5,760 bytes/day=339,840 bytes/day345,600bytes/day−5,760bytes/day=339,840bytes/day | ||||
| //     (about 331.5 KB / day or 9.72 MB / month) | ||||
| //   In practice, savings will be even higher when gas is not being consumed continuously. | ||||
| // | ||||
| //	Storage for non-NULL values every second: | ||||
| //	  86,400 entries/day×4 bytes/entry=345,600 bytes/day86,400entries/day×4bytes/entry=345,600bytes/day | ||||
| //	Storage for non-NULL values every minute: | ||||
| //	  1,440 entries/day×4 bytes/entry=5,760 bytes/day1,440entries/day×4bytes/entry=5,760bytes/day | ||||
| //	Storage savings: | ||||
| //	  345,600 bytes/day−5,760 bytes/day=339,840 bytes/day345,600bytes/day−5,760bytes/day=339,840bytes/day | ||||
| //	  (about 331.5 KB / day or 9.72 MB / month) | ||||
| //	In practice, savings will be even higher when gas is not being consumed continuously. | ||||
| // | ||||
| // When Tariff 1 is active, Tariff 2 isn't. | ||||
| // When energy is being imported, it is not being returned. | ||||
| //   Therefore, only updating their values on-change should save at least 75% storage capacity requirements | ||||
| //   An average month has 2 629 743.83 seconds. | ||||
| //   This saves at least: | ||||
| //     2,629,743.83 seconds * 4 bytes = 10,518,975.32 bytes = 10,518.98 kB = 10.52 MB | ||||
| //   This applies both to Dt1 and Dt2 as well as Rt1 and Rt2, only one is recorded at a time. | ||||
| //     10.52 * 3 = 31.56 MB. | ||||
| // | ||||
| //	Therefore, only updating their values on-change should save at least 75% storage capacity requirements | ||||
| //	An average month has 2 629 743.83 seconds. | ||||
| //	This saves at least: | ||||
| //	  2,629,743.83 seconds * 4 bytes = 10,518,975.32 bytes = 10,518.98 kB = 10.52 MB | ||||
| //	This applies both to Dt1 and Dt2 as well as Rt1 and Rt2, only one is recorded at a time. | ||||
| //	  10.52 * 3 = 31.56 MB. | ||||
| // | ||||
| // In addition, many meters only update these metrics once every 10 seconds, | ||||
| // meaning even more storage capacity is saved: | ||||
| // 10.52 / 10 * 9 = 9,468 MB. | ||||
| 
 | ||||
| type Payload struct { | ||||
| 	T   string `json:"t"`   // Timestamp | ||||
| 	Dt1 *int   `json:"dt1"` // Delivered / imported meter reading tariff 1 (kWh) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue