def save_portfolio(self, datetime, portfolio, perf_tracker, recorded_vars):
        if perf_tracker.progress != 0.0 and self.table:

            metrics = perf_tracker.to_dict()
            metrics.update({
                'date': datetime,
                'recorded': recorded_vars,
                'portfolio': dbutils.portfolio_to_dict(portfolio)
            })

            log.debug('Saving metrics in database')
            log.debug(
                rdb.table(self.table)
                   .insert(metrics)
                   .run(self.session)
            )
Handle file or configuration changes.
dataset/ETHPy150Open intuition-io/insights/insights/plugins/database/rethink.py/RethinkdbFinance.save_portfolio--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/module.py/ManualScalingModule._handle_changes