-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error #1960
Labels
info-needed
Issue requires more information from poster
Comments
github-actions
bot
added
the
triage-needed
Issues needing to be assigned to the prospective feature owner
label
Oct 21, 2024
To investgate I would need a reproducible example
|
aeschli
added
info-needed
Issue requires more information from poster
and removed
triage-needed
Issues needing to be assigned to the prospective feature owner
labels
Oct 23, 2024
this is error that its keep showing every time i ask it to fix my mistakes
or error which i don't understand and here is the code that it give me :
```
import sqlite3
import logging
import traceback
import matplotlib.pyplot as plt
logger = logging.getLogger(__name__)
class ResourceManager:
def __init__(self, db_connection):
self.db_connection = db_connection
def save_resource_usage(self, timestamp, resource_usage):
"""
Saves resource usage data to the database.
"""
try:
cursor = self.db_connection.cursor()
cursor.execute('''
INSERT INTO resource_usage (timestamp, cpu, memory, disk)
VALUES (?, ?, ?, ?)
''', (timestamp, resource_usage['cpu'],
resource_usage['memory'], resource_usage['disk']))
self.db_connection.commit()
logger.info("Resource usage data saved to database.")
except Exception as e:
logger.error(f"Error saving resource usage to database: {e}")
logger.debug(traceback.format_exc())
def get_resource_usage_data(self):
"""
Retrieves resource usage data from the database.
"""
try:
cursor = self.db_connection.cursor()
cursor.execute('SELECT * FROM resource_usage')
return cursor.fetchall()
except Exception as e:
logger.error(f"Error retrieving resource usage data: {e}")
logger.debug(traceback.format_exc())
return []
def visualize_resource_usage(self):
"""
Generates and saves a graph of resource usage over time.
"""
try:
data = self.get_resource_usage_data()
if not data:
return
timestamps, cpu_usages, memory_usages, disk_usages =
zip(*[(row[1], row[2], row[3], row[4]) for row in data])
plt.figure(figsize=(10, 6))
plt.plot(timestamps, cpu_usages, label='CPU Usage (%)')
plt.plot(timestamps, memory_usages, label='Memory Usage (%)')
plt.plot(timestamps, disk_usages, label='Disk Usage (%)')
plt.xlabel('Timestamp')
plt.ylabel('Usage (%)')
plt.title('System Resource Usage Over Time')
plt.legend()
plt.xticks(rotation=45)
plt.tight_layout()
plt.savefig('resource_usage.png')
plt.close()
logger.info("Resource usage graph saved as resource_usage.png.")
except Exception as e:
logger.error(f"Error generating resource usage graph: {e}")
logger.debug(traceback.format_exc())"
```
I will really appreciate it if you guys can fix this issue.
thankyou,
mk
|
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
vs-code-engineering
bot
closed this as not planned
Won't fix, can't repro, duplicate, stale
Oct 31, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Type: Bug
not fixing not updating code for apply changes to certain parts to fix issue
Extension version: 0.21.2
VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z)
OS version: Windows_NT x64 10.0.22631
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: