}
if (save.saveThreadCounts()){
writer.addAttribute(ATT_GRP_THRDS, String.valueOf(res.getGroupThreads()));
writer.addAttribute(ATT_ALL_THRDS, String.valueOf(res.getAllThreads()));
}
SampleEvent event = (SampleEvent) context.get(SaveService.SAMPLE_EVENT_OBJECT);
if (event != null) {
if (save.saveHostname()){
writer.addAttribute(ATT_HOSTNAME, event.getHostname());
}
for (int i = 0; i < SampleEvent.getVarCount(); i++){
writer.addAttribute(SampleEvent.getVarName(i), ConversionHelp.encode(event.getVarValue(i)));
}
}
}