DTSC pull input now supports keeping stream UTC offset intact between servers, plus a local fallback calculation for older versions
This commit is contained in:
		
							parent
							
								
									9403d34eb4
								
							
						
					
					
						commit
						4a866305e5
					
				
					 4 changed files with 35 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -166,6 +166,7 @@ namespace Mist{
 | 
			
		|||
      DTSC::Meta nM("", metaPack.getScan());
 | 
			
		||||
      meta.reInit(streamName, false);
 | 
			
		||||
      meta.merge(nM, true, false);
 | 
			
		||||
      meta.setBootMsOffset(nM.getBootMsOffset());
 | 
			
		||||
      std::set<size_t> validTracks = M.getMySourceTracks(getpid());
 | 
			
		||||
      userSelect.clear();
 | 
			
		||||
      for (std::set<size_t>::iterator it = validTracks.begin(); it != validTracks.end(); ++it){
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -244,6 +244,20 @@ namespace Mist{
 | 
			
		|||
          }
 | 
			
		||||
        }
 | 
			
		||||
        meta.reloadReplacedPagesIfNeeded();
 | 
			
		||||
        // Unix Time at zero point of a stream
 | 
			
		||||
        if (metaScan.hasMember("unixzero")){
 | 
			
		||||
          meta.setBootMsOffset(metaScan.getMember("unixzero").asInt() - Util::unixMS() + Util::bootMS());
 | 
			
		||||
        }else{
 | 
			
		||||
          MEDIUM_MSG("No member \'unixzero\' found in DTSC::Scan. Calculating locally.");
 | 
			
		||||
          int64_t lastMs = 0;
 | 
			
		||||
          std::set<size_t> tracks = M.getValidTracks();
 | 
			
		||||
          for (std::set<size_t>::iterator it = tracks.begin(); it != tracks.end(); it++){
 | 
			
		||||
            if (M.getLastms(*it) > lastMs){
 | 
			
		||||
              lastMs = M.getLastms(*it);
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          meta.setBootMsOffset(Util::bootMS() - lastMs);
 | 
			
		||||
        }
 | 
			
		||||
        std::stringstream rep;
 | 
			
		||||
        rep << "DTSC_HEAD parsed, we went from " << prevTracks << " to " << meta.getValidTracks().size() << " tracks. Bring on those data packets!";
 | 
			
		||||
        sendOk(rep.str());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,7 +20,7 @@ JSON::Value & pData = pStat["proc_status_update"]["status"];
 | 
			
		|||
tthread::mutex statsMutex;
 | 
			
		||||
uint64_t statSinkMs = 0;
 | 
			
		||||
uint64_t statSourceMs = 0;
 | 
			
		||||
uint64_t bootMsOffset = 0;
 | 
			
		||||
int64_t bootMsOffset = 0;
 | 
			
		||||
 | 
			
		||||
namespace Mist{
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue