@Test
public void test_render_task_template() throws Exception {
project.setLogCollection("flash_dog_log");
project.setMetricCollection("flash_dog_metrics");
Task task1 = creator.renderTask(task, project);
assertEquals(task.getCron(), task1.getCron());
assertEquals(task.getName(), task1.getName());
assertEquals(task.getTimeout(), task1.getTimeout());
assertEquals(" //统计错误日志占比\n" +
" err=db.flash_dog_log.find({'level':'ERROR',timestamp:{$gt:new Date(new Date - 300000)}}).count()\n" +
" total=db.flash_dog_log.find({timestamp:{$gt:new Date(new Date - 300000)}}).count();\n" +
" if(total==0)total=1;\n" +
" value=err*100/total;\n" +
" db.flash_dog_metrics.save({name:'错误日志百分比',value:value,timeStamp:new Date().getTime()});\n" +
" return value;", task1.getScript());
}