| 142 | memory: any; |
| 143 | |
| 144 | analyze(evaluation: Evaluation, db: Database) { |
| 145 | let time; |
| 146 | let memory; |
| 147 | for(let block of db.blocks) { |
| 148 | for(let scan of block.parse.scanLike) { |
| 149 | if(scan.type === "record") { |
| 150 | for(let attribute of scan.attributes) { |
| 151 | if(attribute.attribute === "tag" && attribute.value.value === "time") { |
| 152 | if(this.time) this.time.close(); |
| 153 | time = this.time = new TimeAgent(); |
| 154 | time.configure(scan); |
| 155 | } else if(attribute.attribute === "tag" && attribute.value.value === "memory") { |
| 156 | if(this.memory) this.memory.close(); |
| 157 | if(global["browser"]) { |
| 158 | memory = this.memory = new BrowserMemoryAgent(); |
| 159 | } else { |
| 160 | memory = this.memory = new MemoryAgent(); |
| 161 | } |
| 162 | memory.configure(scan); |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | if(time) { |
| 169 | time.setup(evaluation) |
| 170 | } |
| 171 | if(memory) { |
| 172 | memory.setup(evaluation); |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | unregister() { |
| 177 | if(this.time) this.time.close(); |