Python API
The Python API is centered around PerfmonitorService, a standalone orchestration class defined in jumper_extension.core.service. It wires together monitoring, visualization, reporting, cell history, and session management and can be used directly from Python code without IPython magics.
Constructing a service
The recommended entry point is the factory function build_perfmonitor_service:
from jumper_extension.core.service import build_perfmonitor_service
service = build_perfmonitor_service()
This function creates:
- A
Settingsinstance holding monitoring and reporting configuration. - A
PerformanceMonitorfor collecting metrics. - A
CellHistorytracker for executed cells. - A
PerformanceVisualizerandPerformanceReporterattached to the monitor and cell history. - A
NotebookScriptWriterfor script recording.
The returned PerfmonitorService exposes methods that mirror the high‑level commands used by the Jupyter API.
build_perfmonitor_service(plots_disabled=False, plots_disabled_reason='Plotting not available.', display_disabled=False, display_disabled_reason='Display not available.', visualizer_backend='matplotlib')
Build a new :class:PerfmonitorService instance.
This factory configures the default monitor, visualizer, reporter, cell history, and script writer for use in Python code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plots_disabled
|
bool
|
If |
False
|
plots_disabled_reason
|
str
|
Human-readable reason shown when plots are disabled. |
'Plotting not available.'
|
display_disabled
|
bool
|
If |
False
|
display_disabled_reason
|
str
|
Human-readable reason shown when rich display is disabled. |
'Display not available.'
|
visualizer_backend
|
str
|
Visualizer backend to use. Supported values:
|
'matplotlib'
|
Returns:
| Name | Type | Description |
|---|---|---|
PerfmonitorService |
PerfmonitorService
|
A fully initialized service instance. |
Examples:
>>> from jumper_extension.core.service import build_perfmonitor_service
>>> service = build_perfmonitor_service()
Source code in jumper_extension/core/service.py
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 | |
build_perfmonitor_magic_adapter(plots_disabled=False, plots_disabled_reason='Plotting not available.', display_disabled=False, display_disabled_reason='Display not available.', visualizer_backend='matplotlib')
Build a new :class:PerfmonitorMagicAdapter instance.
This factory constructs a :class:PerfmonitorService and wraps it
with a string-based adapter suitable for IPython magics or other
command-style interfaces.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plots_disabled
|
bool
|
If |
False
|
plots_disabled_reason
|
str
|
Human-readable reason shown when plots are disabled. |
'Plotting not available.'
|
display_disabled
|
bool
|
If |
False
|
display_disabled_reason
|
str
|
Human-readable reason shown when rich display is disabled. |
'Display not available.'
|
visualizer_backend
|
str
|
Visualizer backend to use. Supported values:
|
'matplotlib'
|
Returns:
| Name | Type | Description |
|---|---|---|
PerfmonitorMagicAdapter |
PerfmonitorMagicAdapter
|
Adapter instance wrapping the service. |
Examples:
>>> from jumper_extension.core.service import (
... build_perfmonitor_magic_adapter,
... )
>>> adapter = build_perfmonitor_magic_adapter()
Source code in jumper_extension/core/service.py
1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 | |
Core service methods
Core methods control monitoring, plotting, and automatic per‑cell reports.
High-level performance monitoring service.
This service wires together monitoring, visualization, reporting, cell history, and script recording. It is the main entry point for using JUmPER from pure Python code.
Examples:
Build a default service::
from jumper_extension.core.service import (
build_perfmonitor_service,
)
service = build_perfmonitor_service()
Source code in jumper_extension/core/service.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | |
start_monitoring(interval=None, monitor_type='default', check_sanity=False, monitor=None)
Start performance monitoring.
This method configures and starts the underlying performance monitor. If an offline (imported) session is currently attached, it is replaced with a new live monitor instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval
|
Optional[float]
|
Sampling interval in seconds. If |
None
|
monitor_type
|
str
|
Monitor backend to use. |
'default'
|
Returns:
| Type | Description |
|---|---|
Optional[ExtensionErrorCode]
|
Optional[ExtensionErrorCode]: An error code if monitoring |
Optional[ExtensionErrorCode]
|
was already running, otherwise |
Examples:
Start monitoring with the default interval::
service.start_monitoring()
Start monitoring with a custom interval::
service.start_monitoring(interval=0.5)
Start multi-node SLURM monitoring::
service.start_monitoring(monitor_type="slurm_multinode")
Source code in jumper_extension/core/service.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | |
stop_monitoring()
Stop the active performance monitoring session.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.stop_monitoring()
Source code in jumper_extension/core/service.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
enable_perfreports(level, interval=None, text=False)
Enable automatic performance reports after each cell.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str
|
Monitoring level ( |
required |
interval
|
Optional[float]
|
Sampling interval in seconds. If provided, this value is used when starting monitoring. |
None
|
text
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
Enable HTML reports at process level::
service.enable_perfreports(level="process")
Enable text reports with a custom interval::
service.enable_perfreports(
level="user",
interval=0.5,
text=True,
)
Source code in jumper_extension/core/service.py
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | |
disable_perfreports()
Disable automatic performance reports after cell execution.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.disable_perfreports()
Source code in jumper_extension/core/service.py
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | |
show_perfreport(cell_range=None, level=None, text=False)
Show a performance report for the current session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell_range
|
Optional[Tuple[int, int]]
|
Optional tuple |
None
|
level
|
Optional[str]
|
Optional monitoring level override. If |
None
|
text
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
Show a report for all cells::
service.show_perfreport()
Show a report for cells 2 through 5 at system level::
service.show_perfreport(
cell_range=(2, 5),
level="system",
)
Source code in jumper_extension/core/service.py
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | |
plot_performance(metrics=None, cell_range=None, level=None, save_jpeg=None, pickle_file=None, backend=None, live=None)
Open an interactive performance plot.
Works for both live and imported sessions. Uses the attached
visualizer to display metrics and interactive widgets. When
level is provided (or inferred for exports), the plot is
rendered directly without ipywidgets, which also enables JPEG
and pickle exports.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metrics
|
Optional[List[str]]
|
Optional list of metric subset names to plot |
None
|
cell_range
|
Optional[Tuple[int, int]]
|
Optional tuple of (start_idx, end_idx) for cell range |
None
|
level
|
Optional[str]
|
Optional performance level for direct plotting |
None
|
save_jpeg
|
Optional[str]
|
Optional path to save plot as JPEG |
None
|
pickle_file
|
Optional[str]
|
Optional path to serialize plot data |
None
|
backend
|
Optional[str]
|
Optional visualizer backend ("matplotlib" or "plotly") |
None
|
live
|
Optional[Tuple[float, float]]
|
If set, tuple of (update_interval, window_seconds) for live plotting |
None
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.plot_performance()
>>> service.plot_performance(
... metrics=["cpu_summary", "memory"],
... level="process",
... cell_range=(0, 3),
... )
>>> service.plot_performance(live=(2.0, 120.0))
Source code in jumper_extension/core/service.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 | |
Data access and export
The service exposes helpers for accessing collected data as pandas
DataFrame objects and exporting or loading them from disk.
High-level performance monitoring service.
This service wires together monitoring, visualization, reporting, cell history, and script recording. It is the main entry point for using JUmPER from pure Python code.
Examples:
Build a default service::
from jumper_extension.core.service import (
build_perfmonitor_service,
)
service = build_perfmonitor_service()
Source code in jumper_extension/core/service.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | |
export_perfdata(file=None, level=None, name=None)
Export performance data or return it as data frames.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
Optional[str]
|
Optional target file path. If provided, data is
written using the monitor's data adapter. If |
None
|
level
|
Optional[str]
|
Optional monitoring level override. If |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, DataFrame]]
|
Optional[Dict[str, pandas.DataFrame]]: If |
Optional[Dict[str, DataFrame]]
|
|
Optional[Dict[str, DataFrame]]
|
|
Examples:
Export metrics to a CSV file::
service.export_perfdata(
file="performance.csv",
level="process",
)
Get a DataFrame in memory::
frames = service.export_perfdata()
df = next(iter(frames.values()))
Source code in jumper_extension/core/service.py
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 | |
load_perfdata(file)
Load performance data from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str
|
Path to a CSV or JSON file containing performance data. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, DataFrame]]
|
Optional[Dict[str, pandas.DataFrame]]: Mapping from the |
Optional[Dict[str, DataFrame]]
|
configured variable name to the loaded data frame. |
Examples:
>>> frames = service.load_perfdata("performance.csv")
>>> df = next(iter(frames.values()))
Source code in jumper_extension/core/service.py
602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | |
export_cell_history(file=None, name=None)
Export cell history or return it as a data frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
Optional[str]
|
Optional target file path. If provided, the cell
history is written to disk. If |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, DataFrame]]
|
Optional[Dict[str, pandas.DataFrame]]: If |
Optional[Dict[str, DataFrame]]
|
|
Optional[Dict[str, DataFrame]]
|
|
Examples:
Export cell history to CSV::
service.export_cell_history(file="cells.csv")
Get the history as a DataFrame::
frames = service.export_cell_history()
df = next(iter(frames.values()))
Source code in jumper_extension/core/service.py
627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | |
load_cell_history(file)
Load cell history from a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str
|
Path to a CSV or JSON file containing cell history. |
required |
Returns:
| Type | Description |
|---|---|
Optional[Dict[str, DataFrame]]
|
Optional[Dict[str, pandas.DataFrame]]: Mapping from the |
Optional[Dict[str, DataFrame]]
|
configured variable name to the loaded data frame. |
Examples:
>>> frames = service.load_cell_history("cells.csv")
>>> df = next(iter(frames.values()))
Source code in jumper_extension/core/service.py
666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 | |
Sessions, scripts, and utilities
For higher‑level workflows, the service also exposes helpers for resources, sessions, and script recording.
For direct interaction with string‑based commands or IPython magics, see the String Based API and Jupyter API sections.
High-level performance monitoring service.
This service wires together monitoring, visualization, reporting, cell history, and script recording. It is the main entry point for using JUmPER from pure Python code.
Examples:
Build a default service::
from jumper_extension.core.service import (
build_perfmonitor_service,
)
service = build_perfmonitor_service()
Source code in jumper_extension/core/service.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 | |
show_resources()
Display available hardware resources.
Prints information about CPUs, memory, and GPUs available to the current or imported session.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.show_resources()
Source code in jumper_extension/core/service.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
show_cell_history()
Show an interactive table of executed cells.
Displays the tracked cell history using an interactive table widget, if available.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.show_cell_history()
Source code in jumper_extension/core/service.py
205 206 207 208 209 210 211 212 213 214 215 216 217 | |
export_session(path=None)
Export the full monitoring session.
This uses :class:SessionExporter to write performance data
and cell history to a directory or zip archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Optional[str]
|
Optional target directory or |
None
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
Export to a directory::
service.export_session("session-dir")
Export to a zip archive::
service.export_session("session.zip")
Source code in jumper_extension/core/service.py
688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 | |
import_session(path)
Import a monitoring session from disk.
Uses :class:SessionImporter to attach performance data and
cell history from the given directory or zip archive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory or |
required |
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.import_session("session.zip")
Source code in jumper_extension/core/service.py
719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | |
fast_setup()
Quickly start monitoring with per-cell reports enabled.
This convenience helper starts monitoring with a one-second
interval and enables HTML performance reports at the process
level.
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
>>> service.fast_setup()
Source code in jumper_extension/core/service.py
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 | |
start_script_recording(output_path=None)
Start recording code from cells to a Python script.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
Optional[str]
|
Optional path to the output script file. If
|
None
|
Returns:
| Type | Description |
|---|---|
None
|
None |
Examples:
Start recording to an auto-generated file::
service.start_script_recording()
Record to a specific script path::
service.start_script_recording("analysis_script.py")
Source code in jumper_extension/core/service.py
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 | |
stop_script_recording()
Stop recording and save accumulated code to a script file.
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Optional[str]: Path to the saved script file, or |
Optional[str]
|
if recording was not active or no cells were captured. |
Examples:
>>> path = service.stop_script_recording()
>>> print(path)
Source code in jumper_extension/core/service.py
787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 | |
monitored()
Context manager for monitoring a code block.
This helper simulates a virtual cell: it registers a synthetic cell before the block and finalizes it afterwards so that the enclosed code is tracked like any other cell.
Yields:
| Name | Type | Description |
|---|---|---|
PerfmonitorService |
PerfmonitorService
|
The current service instance, for |
PerfmonitorService
|
optional use inside the context. |
Examples:
Use the service as a monitoring context::
with service.monitored():
do_expensive_work()
Source code in jumper_extension/core/service.py
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 | |