2013-10-16 2 views

답변

0

더 많은 정보가 없으면 질문에 대답하기가 어렵습니다. 생성)

RRD를 XML 파일에 당신은 당신이하고 싶은 단위에 따라

1) (데이터 주파수 : 이러한 일반적인 단계는 당신이, 당신이 무엇을해야하는지 이해하고 문제를 해결하는 데 도움이 될 수 있습니다 같은 예를 들어, 시간별 및 일별 데이터를하고 싶은 경우에, 당신의 아카이브를 만들지 보일 것입니다 :

RrdDef rrdDef = new RrdDef(fileName, 60); // 60 is step, means you expect data to enter at 60 seconds interval 
rrdDef.setStartTime(...); // Set initial timestamp here (must be 10 digit epoch timestamp) 
rrdDef.addDatasource(DATASOURCE_NAME, DsType.GAUGE, 120, 0, Double.NaN); // DATASOURCE_NAME is the name of your variable in time series, DsType - is the type of data (always increasing, increasing and decreasing, etc), 120 is the timeout for new data entry, (i.e if no data enters in 120 seconds, NaN will be added to database), max and min values 
rrdDef.addArchive(ConsolFun.AVERAGE, 0.99, 1, 60); 
rrdDef.addArchive(ConsolFun.AVERAGE, 0.99, 24, 240); 

RrdDb rrdDb = new RrdDb(rrdDef); 
rrdDb.close(); 

가 (그 구성의 모든 작업중인 시계열의 자세한 analisys에서 오는, 그것은 예측하기 정말 어렵다 데이터를 보지 않은 것)

2) SAX를 사용하여 XML 파일을 구문 분석 (난 당신이 XML을 구문 분석하는 동안

3), 업데이트) 더 이상 구문 분석 된 값에 액세스 할 수

RrdDb rrdDb = new RrdDb(fileName); 
Sample sample = rrdDb.createSample(); 
sample.setAndUpdate(timestamp+":"+value); 
rrdDb.close(); 
RRD 필요하지 않습니다이 일 후 insertiong RRD 데이터베이스로부터 더 좋을 것 같아요 모든 데이터가 몇몇 그래프 (RRD4J 웹 사이트의 예 및 옵션을 확인)을 생성 삽입

4)

PS (예를 들어 자신의 페이지에있는도이다 RRD4J 많은 시간 outperformes MongoDB를 가진 intergration를 사용)

희망이 도움이 :-)

관련 문제